[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-content/themes/twentysixteen/ -> single.php (source)

   1  <?php
   2  /**
   3   * The template for displaying all single posts and attachments
   4   *
   5   * @package WordPress
   6   * @subpackage Twenty_Sixteen
   7   * @since Twenty Sixteen 1.0
   8   */
   9  
  10  get_header(); ?>
  11  
  12  <div id="primary" class="content-area">
  13      <main id="main" class="site-main">
  14          <?php
  15          // Start the loop.
  16          while ( have_posts() ) :
  17              the_post();
  18  
  19              // Include the single post content template.
  20              get_template_part( 'template-parts/content', 'single' );
  21  
  22              // If comments are open or we have at least one comment, load up the comment template.
  23              if ( comments_open() || get_comments_number() ) {
  24                  comments_template();
  25              }
  26  
  27              if ( is_singular( 'attachment' ) ) {
  28                  // Parent post navigation.
  29                  the_post_navigation(
  30                      array(
  31                          'prev_text' => _x( '<span class="meta-nav">Published in</span><span class="post-title">%title</span>', 'Parent post link', 'twentysixteen' ),
  32                      )
  33                  );
  34              } elseif ( is_singular( 'post' ) ) {
  35                  // Previous/next post navigation.
  36                  the_post_navigation(
  37                      array(
  38                          'next_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Next', 'twentysixteen' ) . '</span> ' .
  39                              '<span class="screen-reader-text">' . __( 'Next post:', 'twentysixteen' ) . '</span> ' .
  40                              '<span class="post-title">%title</span>',
  41                          'prev_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Previous', 'twentysixteen' ) . '</span> ' .
  42                              '<span class="screen-reader-text">' . __( 'Previous post:', 'twentysixteen' ) . '</span> ' .
  43                              '<span class="post-title">%title</span>',
  44                      )
  45                  );
  46              }
  47  
  48              // End the loop.
  49          endwhile;
  50          ?>
  51  
  52      </main><!-- .site-main -->
  53  
  54      <?php get_sidebar( 'content-bottom' ); ?>
  55  
  56  </div><!-- .content-area -->
  57  
  58  <?php get_sidebar(); ?>
  59  <?php get_footer(); ?>


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