-
Notifications
You must be signed in to change notification settings - Fork 1
/
loop-blog.php
44 lines (34 loc) · 1.15 KB
/
loop-blog.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
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<p class="date"><time datetime="<?php the_time( 'Y-m-d' ); ?>"><?php the_time( 'F jS, Y' ); ?> • Posted in <?php the_category( ', ' ); ?></time></p>
<?php if ( has_post_thumbnail() ) : ?>
<?php echo the_post_thumbnail( '' ); ?>
<?php endif; ?>
</header>
<?php the_content(); ?>
<footer>
<?php wp_link_pages( 'before=<div class="post-page-links">Page:&after=</div>' ); ?>
<?php if ( has_tag() ) : ?>
<nav>
<ul>
<li><?php the_tags( ' • Tagged with ', ', ', '' ); ?></li>
</ul>
</nav>
<?php endif; ?>
</footer>
</article>
<?php endwhile; ?>
<?php if ( show_posts_nav() ) : ?>
<nav id="pagination">
<ul>
<li class="previous"><?php next_posts_link( '« Previous' ) ?></li>
<li class="next"><?php previous_posts_link( 'Next »' ) ?></li>
</ul>
</nav>
<?php endif; ?>
<?php else : ?>
<?php get_template_part( 'no-results' ); ?>
<?php endif; ?>