This repository has been archived by the owner on May 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
loop.php
52 lines (45 loc) · 2.22 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php ?>
<section class="primary-content">
<?php $firstClass = 'first-post'; ?>
<?php /* If there are no posts to display, such as an empty archive page */ ?>
<?php if ( ! have_posts() ) : ?>
<article role="main" class="the-content">
<h1><?php _e( '404 - I'm sorry but the page can't be found' ); ?></h1>
<p>Please try searching again or head back to the homepage.</p>
</article>
<?php endif; ?>
<?php ?>
<h1>
<?php if ( is_day() ) : ?><?php printf( __( '<span>Daily Archive</span> %s' ), get_the_date() ); ?>
<?php elseif ( is_month() ) : ?><?php printf( __( '<span>Monthly Archive</span> %s' ), get_the_date('F Y') ); ?>
<?php elseif ( is_year() ) : ?><?php printf( __( '<span>Yearly Archive</span> %s' ), get_the_date('Y') ); ?>
<?php elseif ( is_category() ) : ?><?php echo single_cat_title(); ?>
<?php elseif ( is_search() ) : ?><?php printf( __( 'Search Results for: %s' ), '<span>' . get_search_query() . '</span>' ); ?>
<?php elseif ( is_home() ) : ?>Latest Posts<?php else : ?>
<?php endif; ?>
</h1>
<?php while ( have_posts() ) : the_post(); ?>
<?php /* How to display standard posts and search results */ ?>
<article class="article-archive <?php echo $firstClass; ?>" id="post-<?php the_ID(); ?>">
<?php $firstClass = ""; ?>
<?php ?>
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( '%s' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark">
<h2><?php the_title(); ?></h2>
</a>
<?php the_excerpt(); ?>
<p class="entry-meta"><time datetime="<?php the_time('l, F jS, Y') ?>" pubdate><?php the_time('l jS F Y') ?></time></p>
</article>
<?php comments_template( '', true ); ?>
<?php endwhile; // End the loop. Whew. ?>
<?php /* Display navigation to next/previous pages when applicable */ ?>
<?php if ( $wp_query->max_num_pages > 1 ) : ?>
<ul class="navigation">
<li class="older">
<?php next_posts_link( __( 'Older posts' ) ); ?>
</li>
<li class="newer">
<?php previous_posts_link( __( 'Newer posts' ) ); ?>
</li>
</ul>
<?php endif; ?>
</section>