forked from milohuang/reverie
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloop.php
executable file
·36 lines (34 loc) · 1.3 KB
/
loop.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
<?php /* If there are no posts to display, such as an empty archive page */ ?>
<?php if (!have_posts()) : ?>
<div class="notice">
<p class="bottom"><?php _e('Sorry, no results were found.', 'reverie'); ?></p>
</div>
<?php get_search_form(); ?>
<?php endif; ?>
<?php /* Start loop */ ?>
<?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>
<?php reverie_entry_meta(); ?>
</header>
<div class="entry-content">
<?php if (is_archive() || is_search()) : // Only display excerpts for archives and search ?>
<?php the_excerpt(); ?>
<?php else : ?>
<?php the_content('Continue reading...'); ?>
<?php endif; ?>
</div>
<footer>
<?php $tag = get_the_tags(); if (!$tag) { } else { ?><p><?php the_tags(); ?></p><?php } ?>
</footer>
<div class="divider"></div>
</article>
<?php endwhile; // End the loop ?>
<?php /* Display navigation to next/previous pages when applicable */ ?>
<?php if ($wp_query->max_num_pages > 1) : ?>
<nav id="post-nav">
<div class="post-previous"><?php next_posts_link( __( '← Older posts', 'reverie' ) ); ?></div>
<div class="post-next"><?php previous_posts_link( __( 'Newer posts →', 'reverie' ) ); ?></div>
</nav>
<?php endif; ?>