single.php 910 B

12345678910111213141516171819202122232425262728293031323334
  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 Affinity
  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( 'prev_text' => '<span class="title">' . esc_html__( 'Previous post', 'affinity' ) . '</span>%title', 'next_text' => '<span class="title">' . esc_html__( 'Next post', 'affinity' ) . '</span>%title' ) );
  16. // If comments are open or we have at least one comment, load up the comment template.
  17. if ( comments_open() || get_comments_number() ) :
  18. comments_template();
  19. endif;
  20. endwhile; // End of the loop.
  21. ?>
  22. </main>
  23. </div>
  24. <?php
  25. get_sidebar();
  26. get_footer();