single.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /**
  3. * The template for displaying all single posts and attachments
  4. *
  5. * @package WordPress
  6. * @subpackage Twenty_Fifteen
  7. * @since Twenty Fifteen 1.0
  8. */
  9. get_header(); ?>
  10. <div id="primary" class="content-area">
  11. <main id="main" class="site-main" role="main">
  12. <?php
  13. // Start the loop.
  14. while ( have_posts() ) : the_post();
  15. /*
  16. * Include the post format-specific template for the content. If you want to
  17. * use this in a child theme, then include a file called called content-___.php
  18. * (where ___ is the post format) and that will be used instead.
  19. */
  20. get_template_part( 'content', get_post_format() );
  21. // If comments are open or we have at least one comment, load up the comment template.
  22. if ( comments_open() || get_comments_number() ) :
  23. comments_template();
  24. endif;
  25. // Previous/next post navigation.
  26. the_post_navigation( array(
  27. 'next_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Next', 'twentyfifteen' ) . '</span> ' .
  28. '<span class="screen-reader-text">' . __( 'Next post:', 'twentyfifteen' ) . '</span> ' .
  29. '<span class="post-title">%title</span>',
  30. 'prev_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Previous', 'twentyfifteen' ) . '</span> ' .
  31. '<span class="screen-reader-text">' . __( 'Previous post:', 'twentyfifteen' ) . '</span> ' .
  32. '<span class="post-title">%title</span>',
  33. ) );
  34. // End the loop.
  35. endwhile;
  36. ?>
  37. </main><!-- .site-main -->
  38. </div><!-- .content-area -->
  39. <?php get_footer(); ?>