single.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  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 TextBook
  8. */
  9. get_header(); ?>
  10. <div id="primary" class="content-area">
  11. <main id="main" class="site-main" role="main">
  12. <?php
  13. while ( have_posts() ) : the_post();
  14. get_template_part( 'components/post/content', get_post_format() );
  15. the_post_navigation( array(
  16. 'prev_text' => '<span class="meta-nav" aria-hidden="true">' . esc_html__( 'Previous', 'textbook' ) . '</span> <span class="meta-title">%title</span>',
  17. 'next_text' => '<span class="meta-nav" aria-hidden="true">' . esc_html__( 'Next', 'textbook' ) . '</span> <span class="meta-title">%title</span>'
  18. ) );
  19. // If comments are open or we have at least one comment, load up the comment template.
  20. if ( comments_open() || get_comments_number() ) :
  21. comments_template();
  22. endif;
  23. endwhile; // End of the loop. ?>
  24. </main><!-- .site-main -->
  25. </div><!-- .content-area -->
  26. <?php
  27. get_sidebar();
  28. get_footer();