[ 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 /* Start the Loop */ ?>
  44                  <?php
  45                  while ( have_posts() ) :
  46                      the_post();
  47                      ?>
  48  
  49                      <?php
  50                          /* Include the Post-Format-specific template for the content.
  51                           * If you want to overload this in a child theme then include a file
  52                           * called content-___.php (where ___ is the Post Format name) and that will be used instead.
  53                           */
  54                          get_template_part( 'content', get_post_format() );
  55                      ?>
  56  
  57                  <?php endwhile; ?>
  58  
  59                  <?php twentyeleven_content_nav( 'nav-below' ); ?>
  60  
  61              <?php else : ?>
  62  
  63                  <article id="post-0" class="post no-results not-found">
  64                      <header class="entry-header">
  65                          <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
  66                      </header><!-- .entry-header -->
  67  
  68                      <div class="entry-content">
  69                          <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
  70                          <?php get_search_form(); ?>
  71                      </div><!-- .entry-content -->
  72                  </article><!-- #post-0 -->
  73  
  74              <?php endif; ?>
  75  
  76              </div><!-- #content -->
  77          </section><!-- #primary -->
  78  
  79  <?php get_sidebar(); ?>
  80  <?php get_footer(); ?>


Generated: Thu Dec 12 01:00:04 2019 Cross-referenced by PHPXref 0.7.1