[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

   1  <?php
   2  /**
   3   * 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   * @link https://developer.wordpress.org/themes/basics/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      /*
  22       * Queue the first post, that way we know
  23       * what date we're dealing with (if that is the case).
  24       *
  25       * We reset this later so we can run the loop
  26       * properly with a call to rewind_posts().
  27       */
  28  if ( have_posts() ) {
  29      the_post();
  30  }
  31  ?>
  32  
  33              <h1 class="page-title">
  34              <?php
  35              if ( is_day() ) {
  36                  /* translators: %s: Date. */
  37                  printf( __( 'Daily Archives: <span>%s</span>', 'twentyten' ), get_the_date() );
  38              } elseif ( is_month() ) {
  39                  /* translators: %s: Date. */
  40                  printf( __( 'Monthly Archives: <span>%s</span>', 'twentyten' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'twentyten' ) ) );
  41              } elseif ( is_year() ) {
  42                  /* translators: %s: Date. */
  43                  printf( __( 'Yearly Archives: <span>%s</span>', 'twentyten' ), get_the_date( _x( 'Y', 'yearly archives date format', 'twentyten' ) ) );
  44              } else {
  45                  _e( 'Blog Archives', 'twentyten' );
  46              }
  47              ?>
  48              </h1>
  49  
  50  <?php
  51      /*
  52       * Since we called the_post() above, we need
  53       * to rewind the loop back to the beginning.
  54       * That way we can run the loop properly, in full.
  55       */
  56      rewind_posts();
  57  
  58      /*
  59       * Run the loop for the archives page to output the posts.
  60       * If you want to overload this in a child theme then include a file
  61       * called loop-archive.php and that will be used instead.
  62       */
  63      get_template_part( 'loop', 'archive' );
  64  ?>
  65  
  66              </div><!-- #content -->
  67          </div><!-- #container -->
  68  
  69  <?php get_sidebar(); ?>
  70  <?php get_footer(); ?>


Generated: Thu Nov 21 01:00:03 2024 Cross-referenced by PHPXref 0.7.1