-
Notifications
You must be signed in to change notification settings - Fork 89
/
archive.php
90 lines (73 loc) · 2.81 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
85
86
87
88
89
90
<?php
/**
* The template for displaying Archive pages.
*
* Used to display archive-type pages if nothing more specific matches a query.
* For example, puts together date-based pages if no date.php file exists.
*
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*/
get_header(); ?>
<div id="content" class="grid_8" role="main">
<?php if ( have_posts() ) : ?>
<?php
/* Queue the first post, that way we know
* what author 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().
*/
the_post();
?>
<div id="archive-intro">
<?php if ( !is_author() ): ?>
<nav class="archive-dropdown">
<select name="archive-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'><option value="">Select Month</option>
<?php wp_get_archives( array('type' => 'monthly', 'format' => 'option' ) ); ?>
</select>
</nav>
<?php endif; ?>
<h3>
<?php if ( 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_author() ) : ?>
<?php printf( 'Author Archives: %s', '<span class="vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '" title="' . esc_attr( get_the_author() ) . '" rel="me">' . get_the_author() . '</a></span>' ); ?>
<?php else : ?>
Blog Archives
<?php endif; ?>
</h3>
<?php if ( is_author() && get_the_author_meta( 'description' ) ): ?>
<p><?php the_author_meta( 'description' ); ?></p>
<?php endif; ?>
</div>
<?php
/* 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();
?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'archive' ); ?>
<?php endwhile; ?>
<?php argo_content_nav( 'nav-below' ); ?>
<?php else : ?>
<article id="post-0" class="post no-results not-found">
<header class="entry-header">
<h1 class="entry-title">Nothing Found</h1>
</header><!-- .entry-header -->
<div class="entry-content">
<p>Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.</p>
<?php get_search_form(); ?>
</div><!-- .entry-content -->
</article><!-- #post-0 -->
<?php endif; ?>
</div><!--/ #content .grid_8-->
<aside id="sidebar" class="grid_4">
<?php get_sidebar(); ?>
</aside>
<!-- /.grid_4 -->
<?php get_footer(); ?>