Нет описания

single.php 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 XShop
  8. */
  9. $xshop_blog_container = get_theme_mod( 'xshop_blog_container', 'container' );
  10. $xshop_blog_layout = get_theme_mod( 'xshop_blog_layout', 'rightside' );
  11. if ( is_active_sidebar( 'sidebar-1' ) && $xshop_blog_layout != 'fullwidth' ) {
  12. $xshop_blog_column = 'col-lg-9';
  13. }else{
  14. $xshop_blog_column = 'col-lg-12';
  15. }
  16. get_header();
  17. ?>
  18. <div class="<?php echo esc_attr($xshop_blog_container); ?> mt-5 mb-5 pt-5 pb-5">
  19. <div class="row">
  20. <?php if ( is_active_sidebar( 'sidebar-1' ) && $xshop_blog_layout == 'leftside' ): ?>
  21. <div class="col-lg-3">
  22. <?php get_sidebar(); ?>
  23. </div>
  24. <?php endif; ?>
  25. <div class="<?php echo esc_attr($xshop_blog_column); ?>">
  26. <main id="primary" class="site-main">
  27. <?php
  28. while ( have_posts() ) :
  29. the_post();
  30. get_template_part( 'template-parts/content', get_post_type() );
  31. the_post_navigation(
  32. array(
  33. 'prev_text' => '<span class="nav-subtitle">' . esc_html__( 'Previous:', 'xshop' ) . '</span> <span class="nav-title">%title</span>',
  34. 'next_text' => '<span class="nav-subtitle">' . esc_html__( 'Next:', 'xshop' ) . '</span> <span class="nav-title">%title</span>',
  35. )
  36. );
  37. // If comments are open or we have at least one comment, load up the comment template.
  38. if ( comments_open() || get_comments_number() ) :
  39. comments_template();
  40. endif;
  41. endwhile; // End of the loop.
  42. ?>
  43. </main><!-- #main -->
  44. </div>
  45. <?php if ( is_active_sidebar( 'sidebar-1' ) && $xshop_blog_layout == 'rightside' ): ?>
  46. <div class="col-lg-3">
  47. <?php get_sidebar(); ?>
  48. </div>
  49. <?php endif; ?>
  50. </div>
  51. </div>
  52. <?php
  53. get_footer();