Guest User

single.php

a guest
Feb 14th, 2020
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  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 HitMag
  8. */
  9.  
  10. get_header(); ?>
  11.  
  12. <?php do_action( 'hitmag_before_content' ); ?>
  13.  
  14. <div id="primary" class="content-area">
  15. <main id="main" class="site-main" role="main">
  16.  
  17. <?php
  18. while ( have_posts() ) : the_post();
  19.  
  20. get_template_part( 'template-parts/content', 'single' );
  21.  
  22. if ( true == get_theme_mod( 'relatedposts_sw', true ) ) :
  23. get_template_part( 'template-parts/related-posts' );
  24. endif;
  25.  
  26. if ( true == get_theme_mod( 'postsnav_sw', true ) ) :
  27. the_post_navigation( array(
  28. 'next_text' => '<span class="meta-nav" aria-hidden="true">' . esc_html__( 'Next Article', 'hitmag' ) . '</span> ' .
  29. '<span class="post-title">%title</span>',
  30. 'prev_text' => '<span class="meta-nav" aria-hidden="true">' . esc_html__( 'Previous Article', 'hitmag' ) . '</span> ' .
  31. '<span class="post-title">%title</span>',
  32. ) );
  33. endif;
  34.  
  35. if ( true == get_theme_mod( 'authorbox_sw', true) ) :
  36. get_template_part( 'template-parts/authorbox' );
  37. endif;
  38.  
  39. do_action( 'hitmag_before_comments_template' );
  40. // If comments are open or we have at least one comment, load up the comment template.
  41. if ( comments_open() || get_comments_number() ) :
  42. comments_template();
  43. do_action( 'hitmag_after_comments_template' );
  44. endif;
  45.  
  46. endwhile; // End of the loop.
  47.  
  48. ?>
  49.  
  50. </main><!-- #main -->
  51. </div><!-- #primary -->
  52.  
  53. <?php
  54. get_sidebar();
  55.  
  56. do_action( 'hitmag_after_content' );
  57.  
  58. get_footer();
Add Comment
Please, Sign In to add comment