single.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 Ixion
  8. */
  9. get_header();
  10. //Starting The Loop earlier to take advantage of functions like has_post_thumbnail()
  11. while ( have_posts() ) : the_post();
  12. if ( has_post_thumbnail() ) : ?>
  13. <div class="post-thumbnail">
  14. <?php the_post_thumbnail( 'ixion-featured-image' ); ?>
  15. </div>
  16. <?php
  17. endif;
  18. if ( 'post' === get_post_type() ) {
  19. get_template_part( 'components/post/content', 'meta' );
  20. }
  21. the_title( '<h1 class="entry-title">', '</h1>' );
  22. ?>
  23. <div id="primary" class="content-area">
  24. <main id="main" class="site-main" role="main">
  25. <?php
  26. get_template_part( 'components/post/content', get_post_format() );
  27. // If comments are open or we have at least one comment, load up the comment template.
  28. if ( comments_open() || get_comments_number() ) :
  29. comments_template();
  30. endif;
  31. the_post_navigation();
  32. ?>
  33. </main>
  34. </div>
  35. <?php
  36. endwhile; // End of the loop.
  37. get_sidebar();
  38. get_footer();