-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathloop.php
More file actions
executable file
·57 lines (55 loc) · 2.01 KB
/
loop.php
File metadata and controls
executable file
·57 lines (55 loc) · 2.01 KB
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
<?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.', 'wpbp' ); ?>
</p>
</div>
<?php get_search_form(); ?>
<?php endif; ?>
<?php /* Start loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php wpbp_post_before(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php wpbp_post_inside_before(); ?>
<header class="post-header">
<h2 class="post-title">
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</h2>
<div class="post-meta">
<time class="post-date updated" datetime="<?php the_time( 'c' ); ?>">
<?php printf( __( 'Posted on %s', 'wpbp' ), get_the_time( __( 'l, F jS, Y', 'wpbp' ) ) ); ?>
</time>
<span class="post-author byline author vcard">
<?php _e( 'by', 'wpbp' ); ?> <?php the_author_posts_link(); ?>
</span>
</div>
</header>
<?php if ( has_post_thumbnail() ) : ?>
<div class="post-thumbnail">
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail( 'thumbnail' ); ?>
</a>
</div>
<?php endif; ?>
<div class="post-content">
<?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search ?>
<?php the_excerpt(); ?>
<?php else : ?>
<?php the_content(); ?>
<?php endif; ?>
</div>
<footer class="post-footer">
<p class="post-tags"><?php the_tags(); ?></p>
</footer>
<?php wpbp_post_inside_after(); ?>
</article>
<?php wpbp_post_after(); ?>
<?php endwhile; // End the loop ?>
<?php /* Display navigation to next/previous pages when applicable */ ?>
<?php if ( $wp_query->max_num_pages > 1 ) : ?>
<nav class="post-nav">
<div class="post-previous"><?php next_posts_link( __( '← Older posts', 'wpbp' ) ); ?></div>
<div class="post-next"><?php previous_posts_link( __( 'Newer posts →', 'wpbp' ) ); ?></div>
</nav>
<?php endif; ?>