Brak opisu

index.php 2.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. /**
  3. * The main template file
  4. *
  5. * This is the most generic template file in a WordPress theme
  6. * and one of the two required files for a theme (the other being style.css).
  7. * It is used to display a page when nothing more specific matches a query.
  8. * E.g., it puts together the home page when no home.php file exists.
  9. *
  10. * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
  11. *
  12. * @package XShop
  13. */
  14. $xshop_blog_container = get_theme_mod( 'xshop_blog_container', 'container' );
  15. $xshop_lite_blog_layout = get_theme_mod( 'xshop_lite_blog_layout', 'leftside' );
  16. $xshop_lite_blog_style = get_theme_mod( 'xshop_lite_blog_style', 'list' );
  17. if ( is_active_sidebar( 'sidebar-1' ) && $xshop_lite_blog_layout != 'fullwidth' ) {
  18. $xshop_blog_column = 'col-lg-9';
  19. }else{
  20. $xshop_blog_column = 'col-lg-12';
  21. }
  22. get_header();
  23. ?>
  24. <div class="<?php echo esc_attr($xshop_blog_container); ?> mt-5 mb-5 pt-5 pb-5">
  25. <div class="row">
  26. <?php if ( is_active_sidebar( 'sidebar-1' ) && $xshop_lite_blog_layout == 'leftside' ): ?>
  27. <div class="col-lg-3">
  28. <?php get_sidebar(); ?>
  29. </div>
  30. <?php endif; ?>
  31. <div class="<?php echo esc_attr($xshop_blog_column); ?>">
  32. <main id="primary" class="site-main">
  33. <?php
  34. if ( have_posts() ) :
  35. if ( is_home() && ! is_front_page() ) :
  36. ?>
  37. <header>
  38. <h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1>
  39. </header>
  40. <?php
  41. endif; ?>
  42. <?php if( $xshop_lite_blog_style == 'grid' ): ?>
  43. <div class="bplus-gridh mb-5">
  44. <div class="grid row" data-masonry='{"percentPosition": true }'>
  45. <?php endif; ?>
  46. <?php
  47. /* Start the Loop */
  48. while ( have_posts() ) :
  49. the_post();
  50. /*
  51. * Include the Post-Type-specific template for the content.
  52. * If you want to override this in a child theme, then include a file
  53. * called content-___.php (where ___ is the Post Type name) and that will be used instead.
  54. */
  55. get_template_part( 'template-parts/content', get_post_type() );
  56. endwhile;
  57. ?>
  58. <?php if( $xshop_lite_blog_style == 'grid' ): ?>
  59. </div>
  60. </div>
  61. <?php endif; ?>
  62. <?php
  63. the_posts_pagination();
  64. else :
  65. get_template_part( 'template-parts/content', 'none' );
  66. endif;
  67. ?>
  68. </main><!-- #main -->
  69. </div>
  70. <?php if ( is_active_sidebar( 'sidebar-1' ) && $xshop_lite_blog_layout == 'rightside' ): ?>
  71. <div class="col-lg-3">
  72. <?php get_sidebar(); ?>
  73. </div>
  74. <?php endif; ?>
  75. </div>
  76. </div>
  77. <?php
  78. get_footer();