[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

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 Twenty Nineteen 1.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                                  /* translators: Hidden accessibility text. */
  40                                  '<span class="screen-reader-text">' . __( 'Next post:', 'twentynineteen' ) . '</span> <br/>' .
  41                                  '<span class="post-title">%title</span>',
  42                              'prev_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Previous Post', 'twentynineteen' ) . '</span> ' .
  43                                  /* translators: Hidden accessibility text. */
  44                                  '<span class="screen-reader-text">' . __( 'Previous post:', 'twentynineteen' ) . '</span> <br/>' .
  45                                  '<span class="post-title">%title</span>',
  46                          )
  47                      );
  48                  }
  49  
  50                  // If comments are open or we have at least one comment, load up the comment template.
  51                  if ( comments_open() || get_comments_number() ) {
  52                      comments_template();
  53                  }
  54  
  55              endwhile; // End the loop.
  56              ?>
  57  
  58          </main><!-- #main -->
  59      </div><!-- #primary -->
  60  
  61  <?php
  62  get_footer();


Generated : Fri Apr 26 08:20:02 2024 Cross-referenced by PHPXref