archive.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * Generic template for 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
  11. * @subpackage Twenty Ten
  12. * @since 3.0.0
  13. */
  14. ?>
  15. <?php get_header(); ?>
  16. <div id="container">
  17. <div id="content">
  18. <?php the_post(); ?>
  19. <?php if ( is_day() ) : ?>
  20. <h1 class="page-title"><?php printf( __( 'Daily Archives: <span>%s</span>', 'twentyten' ), get_the_date() ); ?></h1>
  21. <?php elseif ( is_month() ) : ?>
  22. <h1 class="page-title"><?php printf( __( 'Monthly Archives: <span>%s</span>', 'twentyten' ), get_the_date('F Y') ); ?></h1>
  23. <?php elseif ( is_year() ) : ?>
  24. <h1 class="page-title"><?php printf( __( 'Yearly Archives: <span>%s</span>', 'twentyten' ), get_the_date('Y') ); ?></h1>
  25. <?php else : ?>
  26. <h1 class="page-title"><?php _e( 'Blog Archives', 'twentyten' ); ?></h1>
  27. <?php endif; ?>
  28. <?php rewind_posts(); ?>
  29. <?php
  30. /* Run the loop for the archives page to output the posts.
  31. * If you want to overload this in a child theme then include a file
  32. * called loop-archives.php and that will be used instead.
  33. */
  34. get_template_part( 'loop', 'archive' );
  35. ?>
  36. </div><!-- #content -->
  37. </div><!-- #container -->
  38. <?php get_sidebar(); ?>
  39. <?php get_footer(); ?>