Skip to content
This repository
Newer
Older
100644 59 lines (53 sloc) 1.658 kb
0ee651c9 »
2011-04-19 Some archive handling.
1 <?php
2 /**
3 * The template for displaying Archive pages.
4 *
5 * Used to display archive-type pages if nothing more specific matches a query.
6 * For example, puts together date-based pages if no date.php file exists.
7 *
8 * Learn more: http://codex.wordpress.org/Template_Hierarchy
9 *
10 * @package WordPress
6f21dc3e »
2011-04-24 Renaming from 'initializr' to 'formattd'.
11 * @subpackage Formattd
ad89bf44 »
2011-04-29 Changing current version to 0.1. Meant to do this before uploading to…
12 * @since Formattd 0.1
0ee651c9 »
2011-04-19 Some archive handling.
13 */
14
15 get_header(); ?>
16
17 <div id="content">
18 <div class="spacer">
19 <?php
20 /* Queue the first post, that way we know
21 * what date we're dealing with (if that is the case).
22 *
23 * We reset this later so we can run the loop
24 * properly with a call to rewind_posts().
25 */
26 if ( have_posts() )
27 the_post();
28 ?>
29
30 <h1 class="page-title">
31 <?php if ( is_day() ) : ?>
6f21dc3e »
2011-04-24 Renaming from 'initializr' to 'formattd'.
32 <?php printf( __( 'Daily Archives: <span>%s</span>', 'formattd' ), get_the_date() ); ?>
0ee651c9 »
2011-04-19 Some archive handling.
33 <?php elseif ( is_month() ) : ?>
6f21dc3e »
2011-04-24 Renaming from 'initializr' to 'formattd'.
34 <?php printf( __( 'Monthly Archives: <span>%s</span>', 'formattd' ), get_the_date( 'F Y' ) ); ?>
0ee651c9 »
2011-04-19 Some archive handling.
35 <?php elseif ( is_year() ) : ?>
6f21dc3e »
2011-04-24 Renaming from 'initializr' to 'formattd'.
36 <?php printf( __( 'Yearly Archives: <span>%s</span>', 'formattd' ), get_the_date( 'Y' ) ); ?>
0ee651c9 »
2011-04-19 Some archive handling.
37 <?php else : ?>
6f21dc3e »
2011-04-24 Renaming from 'initializr' to 'formattd'.
38 <?php _e( 'Blog Archives', 'formattd' ); ?>
0ee651c9 »
2011-04-19 Some archive handling.
39 <?php endif; ?>
40 </h1>
41
42 <?php
43 /* Since we called the_post() above, we need to
44 * rewind the loop back to the beginning that way
45 * we can run the loop properly, in full.
46 */
47 rewind_posts();
48
49 /* Run the loop for the archives page to output the posts.
50 * If you want to overload this in a child theme then include a file
51 * called loop-archive.php and that will be used instead.
52 */
53 get_template_part( 'loop', 'archive' );
54 ?>
55 </div><!--.spacer-->
56 </div><!--#content-->
57 <?php get_sidebar(); ?>
58 <?php get_footer(); ?>
Something went wrong with that request. Please try again.