forked from zutrinken/Scapegoat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfront-page.php
67 lines (53 loc) · 2.39 KB
/
front-page.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php get_header(); ?>
<!-- Mobiel Detect -->
<?php $detect = new Mobile_Detect(); ?>
<div id="container">
<div id="content" role="main">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<section id="post-<?php the_ID(); ?>" <?php if (is_front_page()) { post_class('front-post'); } else { post_class(); } ?>>
<?php if(has_post_thumbnail()) : ?>
<figure class="post-image">
<a title="<?php the_title(); ?>" href="<?php the_permalink(); ?>">
<!-- Mobile Query -->
<?php if($detect->isMobile() && !$detect->isTablet()) : ?>
<?php the_post_thumbnail('medium'); ?>
<?php else : ?>
<?php the_post_thumbnail('teaser'); ?>
<?php endif; ?>
</a>
<?php if(get_post(get_post_thumbnail_id())->post_excerpt) : ?>
<span class="meta-thumbnail-caption">
<?php echo get_post(get_post_thumbnail_id())->post_excerpt; ?>
</span>
<?php endif; ?>
</figure>
<?php endif; ?>
<article class="article">
<?php the_content(); ?>
</article><!-- .article -->
</section><!-- .post -->
<?php endwhile; ?>
<?php endif; ?>
<section id="frontpage-news">
<h2>Neuigkeiten <a href="/category/news/" title="Mehr News">»</a></h2>
<ul>
<?php
// Query Post for Frontpage (Category-ID 3 "News")
wp_reset_query();
//query_posts( 'cat=3&posts_per_page=5' ); //hard coded category id isn't portable!
$news_category=get_cat_ID("News");
query_posts( 'cat=$news_category&posts_per_page=5' );
while (have_posts()) : the_post(); ?>
<li><span class="news-date"><?php the_time('j.m.y'); ?></span>
<a title="<?php echo strip_tags(get_the_excerpt()); ?>" href="<?php the_permalink(); ?>">
<?php the_title(); ?>
</a>
</li>
<?php endwhile; ?>
</ul>
</section>
</div><!-- #content -->
<?php get_sidebar(); ?>
<div class="clear"></div>
</div><!-- #container -->
<?php get_footer(); ?>