[ XREF Home ] [ Index ]

PHP Cross Reference of WordPress Trunk

Provided by Yoast

title

Body

[close]

/wp-content/themes/twentyeleven/ -> 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_Eleven
  12   * @since Twenty Eleven 1.0
  13   */
  14  
  15  get_header(); ?>
  16  
  17          <section id="primary">
  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                  <header class="page-header">
  32                      <h1 class="page-title">
  33                          <?php if ( is_day() ) : ?>
  34                              <?php printf( __( 'Daily Archives: %s', 'twentyeleven' ), '<span>' . get_the_date() . '</span>' ); ?>
  35                          <?php elseif ( is_month() ) : ?>
  36                              <?php printf( __( 'Monthly Archives: %s', 'twentyeleven' ), '<span>' . get_the_date( 'F Y' ) . '</span>' ); ?>
  37                          <?php elseif ( is_year() ) : ?>
  38                              <?php printf( __( 'Yearly Archives: %s', 'twentyeleven' ), '<span>' . get_the_date( 'Y' ) . '</span>' ); ?>
  39                          <?php else : ?>
  40                              <?php _e( 'Blog Archives', 'twentyeleven' ); ?>
  41                          <?php endif; ?>
  42                      </h1>
  43                  </header>
  44  
  45                  <?php
  46                      /* Since we called the_post() above, we need to
  47                       * rewind the loop back to the beginning that way
  48                       * we can run the loop properly, in full.
  49                       */
  50                      rewind_posts();
  51                  ?>
  52  
  53                  <?php twentyeleven_content_nav( 'nav-above' ); ?>
  54  
  55                  <?php /* Start the Loop */ ?>
  56                  <?php while ( have_posts() ) : the_post(); ?>
  57  
  58                      <?php
  59                          /* Include the Post-Format-specific template for the content.
  60                           * If you want to overload this in a child theme then include a file
  61                           * called content-___.php (where ___ is the Post Format name) and that will be used instead.
  62                           */
  63                          get_template_part( 'content', get_post_format() );
  64                      ?>
  65  
  66                  <?php endwhile; ?>
  67  
  68                  <?php twentyeleven_content_nav( 'nav-below' ); ?>
  69  
  70              </div><!-- #content -->
  71          </section><!-- #primary -->
  72  
  73  <?php get_sidebar(); ?>
  74  <?php get_footer(); ?>


Generated: Wed Jun 1 08:30:02 2011 Cross-referenced by PHPXref 0.7
Provided by Yoast and awesome WordPress Hosting