forked from grayghostvisuals/wp-flex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
archive.php
executable file
·84 lines (74 loc) · 2.99 KB
/
archive.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php get_header(); ?>
<?php
/* Queue the first post, that way we know
* what date we're dealing with (if that is the case).
*
* We reset this later so we can run the loop
* properly with a call to rewind_posts().
*/
if ( have_posts() ) the_post();
/* Since we called the_post() above, we need to
* rewind the loop back to the beginning that way
* we can run the loop properly, in full.
*/
rewind_posts();
?>
<section class="clearfix" id="content" role="main">
<h1 class="page-title">
<?php if ( is_day() ) : ?>
<?php printf( 'Daily Archives: <span>%s</span>', get_the_date() ); ?>
<?php elseif ( is_month() ) : ?>
<?php printf( 'Monthly Archives: <span>%s</span>', get_the_date( 'F Y' ) ); ?>
<?php elseif ( is_year() ) : ?>
<?php printf( 'Yearly Archives: <span>%s</span>', get_the_date( 'Y' ) ); ?>
<?php elseif ( is_tag() ) : ?>
<?php printf( single_tag_title( 'Tag Archives : ' ) . ' ' . '<span>%s</span>', get_the_date( 'F Y' ) ); ?>
<?php else : ?>
<?php echo ( 'The Archives' ); ?>
<?php endif; //end initial if ?>
</h1>
<?php if( have_posts() ) : while( have_posts() ) : the_post()?>
<article <?php post_class(); ?> id="post-<?php the_ID(); ?>">
<header>
<h1 class="entry-title"><a href="<?php the_permalink() ?>" rel="bookmark tag" title="<?php the_title(); ?> blog post entry"><?php the_title(); ?></a></h1>
<?php get_template_part( 'inc/meta' ); ?>
</header>
<!-- *optional* remove read more link -->
<!-- http://codex.wordpress.org/Customizing_the_Read_More -->
<!-- Resolves Issue #4: https://github.com/grayghostvisuals/WP-Flex/issues/4 -->
<div class="entry-content">
<?php the_content(); ?>
</div>
<!-- post footer -->
<footer class="entry-footer">
<div class="comments-count">
<a href="<?php comments_link(); ?>" class="comments-count-number"><?php comments_number( '0', '1', '%' ); ?>Comments</a>
</div>
<ul class="entry-taxonomies">
<li>
<?php echo ( 'Tagged:' ); ?>
<ul class="entry-tags-list">
<li class="entry-tags"><?php the_tags( '</li><li>' ); ?></li>
</ul>
</li>
<li>
<?php echo ( 'Filed under:' ); ?>
<ul class="entry-categories-list">
<li class="entry-categories"><?php the_category( '</li><li>,' ) ?></li>
</ul>
</li>
</ul>
</footer>
</article>
<?php endwhile; //end while have_posts() loop ?>
<!-- post loop error message -->
<?php else : //if no posts were found do this ?>
<p><?php echo ( 'Holy smokes! This is totally crazy. No posts match anything even remotely close to that in our database. Sorry Mon Frere, try again' ); ?></p>
<?php endif; //end if have_posts condition ?>
<p><?php posts_nav_link( '∞', '← Go Forward In Time', 'Go Back In Time →' ); ?></p>
</section>
<!-- sidebar -->
<aside id="sidebar" role="complementary">
<?php get_sidebar(); ?>
</aside>
<?php get_footer(); ?>