[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-content/themes/twentyeleven/ -> 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_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 if ( have_posts() ) : ?>
  21  
  22                  <header class="page-header">
  23                      <h1 class="page-title">
  24                          <?php
  25                          if ( is_day() ) {
  26                              /* translators: %s: Date. */
  27                              printf( __( 'Daily Archives: %s', 'twentyeleven' ), '<span>' . get_the_date() . '</span>' );
  28                          } elseif ( is_month() ) {
  29                              /* translators: %s: Date. */
  30                              printf( __( 'Monthly Archives: %s', 'twentyeleven' ), '<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'twentyeleven' ) ) . '</span>' );
  31                          } elseif ( is_year() ) {
  32                              /* translators: %s: Date. */
  33                              printf( __( 'Yearly Archives: %s', 'twentyeleven' ), '<span>' . get_the_date( _x( 'Y', 'yearly archives date format', 'twentyeleven' ) ) . '</span>' );
  34                          } else {
  35                              _e( 'Blog Archives', 'twentyeleven' );
  36                          }
  37                          ?>
  38                      </h1>
  39                  </header>
  40  
  41                  <?php twentyeleven_content_nav( 'nav-above' ); ?>
  42  
  43                  <?php
  44                  // Start the Loop.
  45                  while ( have_posts() ) :
  46                      the_post();
  47                      ?>
  48  
  49                      <?php
  50                          /*
  51                           * Include the Post-Format-specific template for the content.
  52                           * If you want to overload this in a child theme then include a file
  53                           * called content-___.php (where ___ is the Post Format name) and that
  54                           * will be used instead.
  55                           */
  56                          get_template_part( 'content', get_post_format() );
  57                      ?>
  58  
  59                  <?php endwhile; ?>
  60  
  61                  <?php twentyeleven_content_nav( 'nav-below' ); ?>
  62  
  63              <?php else : ?>
  64  
  65                  <article id="post-0" class="post no-results not-found">
  66                      <header class="entry-header">
  67                          <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
  68                      </header><!-- .entry-header -->
  69  
  70                      <div class="entry-content">
  71                          <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
  72                          <?php get_search_form(); ?>
  73                      </div><!-- .entry-content -->
  74                  </article><!-- #post-0 -->
  75  
  76              <?php endif; ?>
  77  
  78              </div><!-- #content -->
  79          </section><!-- #primary -->
  80  
  81  <?php get_sidebar(); ?>
  82  <?php get_footer(); ?>


Generated: Sun Nov 24 01:00:02 2024 Cross-referenced by PHPXref 0.7.1