[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

   1  <?php
   2  /**
   3   * The template for displaying all single posts
   4   *
   5   * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
   6   *
   7   * @package WordPress
   8   * @subpackage Twenty_Nineteen
   9   * @since 1.0.0
  10   */
  11  
  12  get_header();
  13  ?>
  14  
  15      <div id="primary" class="content-area">
  16          <main id="main" class="site-main">
  17  
  18              <?php
  19  
  20              /* Start the Loop */
  21              while ( have_posts() ) :
  22                  the_post();
  23  
  24                  get_template_part( 'template-parts/content/content', 'single' );
  25  
  26                  if ( is_singular( 'attachment' ) ) {
  27                      // Parent post navigation.
  28                      the_post_navigation(
  29                          array(
  30                              /* translators: %s: Parent post link. */
  31                              'prev_text' => sprintf( __( '<span class="meta-nav">Published in</span><span class="post-title">%s</span>', 'twentynineteen' ), '%title' ),
  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 Post', 'twentynineteen' ) . '</span> ' .
  39                                  '<span class="screen-reader-text">' . __( 'Next post:', 'twentynineteen' ) . '</span> <br/>' .
  40                                  '<span class="post-title">%title</span>',
  41                              'prev_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Previous Post', 'twentynineteen' ) . '</span> ' .
  42                                  '<span class="screen-reader-text">' . __( 'Previous post:', 'twentynineteen' ) . '</span> <br/>' .
  43                                  '<span class="post-title">%title</span>',
  44                          )
  45                      );
  46                  }
  47  
  48                  // If comments are open or we have at least one comment, load up the comment template.
  49                  if ( comments_open() || get_comments_number() ) {
  50                      comments_template();
  51                  }
  52  
  53              endwhile; // End of the loop.
  54              ?>
  55  
  56          </main><!-- #main -->
  57      </div><!-- #primary -->
  58  
  59  <?php
  60  get_footer();


Generated: Mon Sep 16 01:00:03 2019 Cross-referenced by PHPXref 0.7.1