blog-grid.php (1370B)
1 <?php 2 global $post; 3 ?> 4 <?php 5 if (is_active_sidebar('sidebar-1')) : 6 $blog_post_list_class = 'col-lg-8'; 7 else : 8 $blog_post_list_class = 'col-lg-12'; 9 endif; 10 ?> 11 <section class="blog-grid sec-pad-2"> 12 <div class="auto-container"> 13 <div class="row clearfix"> 14 <div class="<?php echo esc_attr($blog_post_list_class); ?> col-md-12 col-sm-12 content-side"> 15 <div class="blog-grid-content"> 16 <div class="row clearfix"> 17 <?php 18 if (have_posts()) : 19 while (have_posts()) : 20 the_post(); 21 get_template_part('template-parts/blog-layout/blog-grid-content'); 22 endwhile; 23 else : 24 get_template_part('template-parts/content', 'none'); 25 endif; 26 ?> 27 </div> 28 </div> 29 <?php if (get_the_posts_pagination()) : ?> 30 <div class="pagination-wrapper"> 31 <?php 32 the_posts_pagination( 33 array( 34 'mid_size' => 2, 35 'prev_text' => '<i class="far fa-angle-left"></i>', 36 'next_text' => '<i class="far fa-angle-right"></i>', 37 ) 38 ); 39 ?> 40 </div> 41 <?php endif; ?> 42 </div> 43 <?php if (is_active_sidebar('sidebar-1')) { ?> 44 <div class="col-lg-4 col-md-12 col-sm-12 sidebar-side"> 45 <div class="blog-sidebar default-sidebar ml-20"> 46 <?php get_sidebar(); ?> 47 </div> 48 </div> 49 <?php } ?> 50 </div> 51 </div> 52 </section>