[ 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                              'prev_text' => _x( '<span class="meta-nav">Published in</span><br><span class="post-title">%title</span>', 'Parent post link', 'twentynineteen' ),
  31                          )
  32                      );
  33                  } elseif ( is_singular( 'post' ) ) {
  34                      // Previous/next post navigation.
  35                      the_post_navigation(
  36                          array(
  37                              'next_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Next Post', 'twentynineteen' ) . '</span> ' .
  38                                  /* translators: Hidden accessibility text. */
  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                                  /* translators: Hidden accessibility text. */
  43                                  '<span class="screen-reader-text">' . __( 'Previous post:', 'twentynineteen' ) . '</span> <br/>' .
  44                                  '<span class="post-title">%title</span>',
  45                          )
  46                      );
  47                  }
  48  
  49                  // If comments are open or we have at least one comment, load up the comment template.
  50                  if ( comments_open() || get_comments_number() ) {
  51                      comments_template();
  52                  }
  53  
  54              endwhile; // End the loop.
  55              ?>
  56  
  57          </main><!-- #main -->
  58      </div><!-- #primary -->
  59  
  60  <?php
  61  get_footer();


Generated : Thu Nov 21 08:20:01 2024 Cross-referenced by PHPXref