[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

title

Body

[close]

/wp-content/themes/twentysixteen/ -> 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   * If you'd like to further customize these archive views, you may create a
   9   * new template file for each one. For example, tag.php (Tag archives),
  10   * category.php (Category archives), author.php (Author archives), etc.
  11   *
  12   * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
  13   *
  14   * @package WordPress
  15   * @subpackage Twenty_Sixteen
  16   * @since Twenty Sixteen 1.0
  17   */
  18  
  19  get_header(); ?>
  20  
  21      <div id="primary" class="content-area">
  22          <main id="main" class="site-main" role="main">
  23  
  24          <?php if ( have_posts() ) : ?>
  25  
  26              <header class="page-header">
  27                  <?php
  28                      the_archive_title( '<h1 class="page-title">', '</h1>' );
  29                      the_archive_description( '<div class="taxonomy-description">', '</div>' );
  30                  ?>
  31              </header><!-- .page-header -->
  32  
  33              <?php
  34              // Start the Loop.
  35              while ( have_posts() ) :
  36                  the_post();
  37  
  38                  /*
  39                   * Include the Post-Format-specific template for the content.
  40                   * If you want to override this in a child theme, then include a file
  41                   * called content-___.php (where ___ is the Post Format name) and that will be used instead.
  42                   */
  43                  get_template_part( 'template-parts/content', get_post_format() );
  44  
  45                  // End the loop.
  46              endwhile;
  47  
  48              // Previous/next page navigation.
  49              the_posts_pagination(
  50                  array(
  51                      'prev_text'          => __( 'Previous page', 'twentysixteen' ),
  52                      'next_text'          => __( 'Next page', 'twentysixteen' ),
  53                      'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>',
  54                  )
  55              );
  56  
  57              // If no content, include the "No posts found" template.
  58          else :
  59              get_template_part( 'template-parts/content', 'none' );
  60  
  61          endif;
  62          ?>
  63  
  64          </main><!-- .site-main -->
  65      </div><!-- .content-area -->
  66  
  67  <?php get_sidebar(); ?>
  68  <?php get_footer(); ?>


Generated: Fri Oct 25 08:20:01 2019 Cross-referenced by PHPXref 0.7