/archive.php
PHP | 35 lines | 21 code | 6 blank | 8 comment | 3 complexity | 7b9efc13de9ba5499649cc679e4c7955 MD5 | raw file
- <?php get_header(); ?>
- <?php
- if ( have_posts() )
- the_post();
- ?>
-
- <h1>
- <?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 else : ?>
- <?php _e( 'The Blog' ); ?>
- <?php endif; ?>
- </h1>
- <?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();
- /* Run the loop for the archives page to output the posts.
- * If you want to overload this in a child theme then include a file
- * called loop-archives.php and that will be used instead.
- */
- get_template_part( 'loop', 'archive' );
- ?>
- <?php get_footer(); ?>