[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-content/themes/twentyten/ -> archive.php (source)

   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
  11   * @subpackage Twenty_Ten
  12   * @since Twenty Ten 1.0
  13   */
  14  
  15  get_header(); ?>
  16  
  17          <div id="container">
  18              <div id="content" role="main">
  19  
  20  <?php
  21      /* Queue the first post, that way we know
  22       * what date we're dealing with (if that is the case).
  23       *
  24       * We reset this later so we can run the loop
  25       * properly with a call to rewind_posts().
  26       */
  27      if ( have_posts() )
  28          the_post();
  29  ?>
  30  
  31              <h1 class="page-title">
  32  <?php if ( is_day() ) : ?>
  33                  <?php printf( __( 'Daily Archives: <span>%s</span>', 'twentyten' ), get_the_date() ); ?>
  34  <?php elseif ( is_month() ) : ?>
  35                  <?php printf( __( 'Monthly Archives: <span>%s</span>', 'twentyten' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'twentyten' ) ) ); ?>
  36  <?php elseif ( is_year() ) : ?>
  37                  <?php printf( __( 'Yearly Archives: <span>%s</span>', 'twentyten' ), get_the_date( _x( 'Y', 'yearly archives date format', 'twentyten' ) ) ); ?>
  38  <?php else : ?>
  39                  <?php _e( 'Blog Archives', 'twentyten' ); ?>
  40  <?php endif; ?>
  41              </h1>
  42  
  43  <?php
  44      /* Since we called the_post() above, we need to
  45       * rewind the loop back to the beginning that way
  46       * we can run the loop properly, in full.
  47       */
  48      rewind_posts();
  49  
  50      /* Run the loop for the archives page to output the posts.
  51       * If you want to overload this in a child theme then include a file
  52       * called loop-archive.php and that will be used instead.
  53       */
  54       get_template_part( 'loop', 'archive' );
  55  ?>
  56  
  57              </div><!-- #content -->
  58          </div><!-- #container -->
  59  
  60  <?php get_sidebar(); ?>
  61  <?php get_footer(); ?>


Generated: Fri May 25 03:56:23 2012 Hosted by follow the white rabbit.