Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.47 KB | None | 0 0
  1. <?php
  2. /**
  3. * Post Page Template ( index.php ).
  4. */
  5.  
  6. global $wp_query, $post;
  7.  
  8. get_header();
  9. get_template_part('page_banner');
  10. get_template_part('inc/start','sidebar');
  11. $paged = get_query_var('paged') ? get_query_var('paged') : (int) absint('1');
  12.  
  13. $counter_1_large_then_3_grid_style = '-1';
  14. $counter_1_masonry_3 = (int) absint('0');
  15. $fixit_blog_counter = $counter_1_large_then_2_grid_style = $counter_1_large_then_list_style = (int) absint('1');
  16.  
  17. if ( have_posts() ){
  18.  
  19. if( mh_get_option( Fixit_Factory::fixit_prefix() . 'blog_page_layout') === 'masonry-2-column-style' or
  20. mh_get_option( Fixit_Factory::fixit_prefix() . 'blog_page_layout') === 'masonry-3-column-style' ){
  21.  
  22. print '<div id="isotope" class="grid row">';
  23. }else{ print '<div class="row">'; }
  24.  
  25.  
  26. while ( have_posts() ) : the_post();
  27.  
  28. if( mh_get_option( Fixit_Factory::fixit_prefix() . 'blog_page_layout') === 'blog-list-column' ){
  29.  
  30. print '<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 blog-post post-block">';
  31. Fixit_Factory::fixit_content( 'list' );
  32. print '</div>';
  33.  
  34. }elseif( mh_get_option( Fixit_Factory::fixit_prefix() . 'blog_page_layout') === '1-large-then-2-grid-style' ){
  35.  
  36. $class_1_large_then_2_grid_style = '';
  37.  
  38. if( $counter_1_large_then_2_grid_style % (int) absint('2') === absint('0') ) $class_1_large_then_2_grid_style .= ' col-lg-clearboth col-md-clearboth col-sm-clearboth';
  39.  
  40. if( (int) absint( $fixit_blog_counter ) === (int) (absint('1')) ){
  41.  
  42. print '<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 blog-post">';
  43. }else{ print '<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 blog-post '. $class_1_large_then_2_grid_style .'">'; }
  44.  
  45. Fixit_Factory::fixit_content( 'content' );
  46.  
  47. print '</div>'; $fixit_blog_counter++; unset( $class_1_large_then_2_grid_style ); $counter_1_large_then_2_grid_style++;
  48.  
  49. }elseif( mh_get_option( Fixit_Factory::fixit_prefix() . 'blog_page_layout') === '1-large-then-3-grid-style' ){
  50.  
  51. $class_1_large_then_3_grid_style = '';
  52.  
  53. if( $counter_1_large_then_3_grid_style % (int) absint('3') === absint('0') ) $class_1_large_then_3_grid_style .= ' col-lg-clearboth col-md-clearboth';
  54. if( $counter_1_large_then_3_grid_style % (int) absint('2') === absint('0') ) $class_1_large_then_3_grid_style .= ' col-sm-clearboth';
  55.  
  56. if( (int) absint( $fixit_blog_counter ) === (int) (absint('1') ) ){
  57.  
  58. print '<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 blog-post">';
  59.  
  60. }else{ print '<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12 blog-post '. $class_1_large_then_3_grid_style .'">'; }
  61.  
  62. Fixit_Factory::fixit_content( 'content' );
  63.  
  64. print '</div>';
  65.  
  66. $fixit_blog_counter++; $counter_1_large_then_3_grid_style++; unset( $class_1_large_then_3_grid_style );
  67.  
  68. }elseif( mh_get_option( Fixit_Factory::fixit_prefix() . 'blog_page_layout') === '1-large-then-list-style' ){
  69.  
  70. if( $fixit_blog_counter === (int)(absint('1')) ){
  71.  
  72. print '<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 blog-post">'; Fixit_Factory::fixit_content( 'content' );
  73.  
  74. }else{ print '<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 blog-post post-block">'; Fixit_Factory::fixit_content( 'list' ); }
  75.  
  76. print '</div>'; $fixit_blog_counter++;
  77.  
  78. }elseif( mh_get_option( Fixit_Factory::fixit_prefix() . 'blog_page_layout') === 'masonry-2-column-style' ){
  79.  
  80. $masonry_3_style = '';
  81.  
  82. if( $counter_1_masonry_3 % (int) absint('2') === absint('0') ) $masonry_3_style .= 'col-lg-clearboth col-md-clearboth col-sm-clearboth';
  83.  
  84. print '<div class="grid-item col-lg-6 col-md-6 col-sm-6 col-xs-12 blog-post '. $masonry_3_style .'">';
  85.  
  86. Fixit_Factory::fixit_content( 'content' );
  87.  
  88. print '</div>';
  89.  
  90. $counter_1_masonry_3++; unset( $masonry_3_style );
  91.  
  92. }elseif( mh_get_option( Fixit_Factory::fixit_prefix() . 'blog_page_layout') === 'masonry-3-column-style' ){
  93.  
  94. $masonry_3_style = '';
  95.  
  96. if( $counter_1_masonry_3 % (int) absint('3') === absint('0') ) $masonry_3_style .= ' col-lg-clearboth col-md-clearboth';
  97. if( $counter_1_masonry_3 % (int) absint('2') === absint('0') ) $masonry_3_style .= ' col-sm-clearboth';
  98.  
  99. print '<div class="grid-item col-lg-4 col-md-4 col-sm-6 col-xs-12 blog-post '. $masonry_3_style .'">';
  100.  
  101. Fixit_Factory::fixit_content( 'content' );
  102.  
  103. print '</div>';
  104.  
  105. $counter_1_masonry_3++; unset( $masonry_3_style );
  106.  
  107. }elseif( mh_get_option( Fixit_Factory::fixit_prefix() . 'blog_page_layout') === 'blog-large-image-style' ){
  108.  
  109. print '<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 blog-post">';
  110.  
  111. Fixit_Factory::fixit_content( 'content' );
  112.  
  113. print '</div>';
  114.  
  115. }elseif( mh_get_option( Fixit_Factory::fixit_prefix() . 'blog_page_layout') === 'blog-simple-two-column-style' ){
  116.  
  117. $masonry_3_style = '';
  118.  
  119. if( $counter_1_masonry_3 % (int) absint('2') === absint('0') ) $masonry_3_style .= 'col-lg-clearboth col-md-clearboth col-sm-clearboth';
  120.  
  121. print '<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 blog-post '. $masonry_3_style .'">';
  122.  
  123. Fixit_Factory::fixit_content( 'content' );
  124.  
  125. print '</div>';
  126.  
  127. $counter_1_masonry_3++; unset( $masonry_3_style );
  128.  
  129. }elseif( mh_get_option( Fixit_Factory::fixit_prefix() . 'blog_page_layout') === 'blog-simple-three-column-style' ){
  130.  
  131. $masonry_3_style = '';
  132.  
  133. if( $counter_1_masonry_3 % (int) absint('3') === absint('0') ) $masonry_3_style .= ' col-lg-clearboth col-md-clearboth';
  134. if( $counter_1_masonry_3 % (int) absint('2') === absint('0') ) $masonry_3_style .= ' col-sm-clearboth';
  135.  
  136. print '<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12 blog-post '. $masonry_3_style .'">';
  137.  
  138. Fixit_Factory::fixit_content( 'content' );
  139.  
  140. print '</div>';
  141.  
  142. $counter_1_masonry_3++; unset( $masonry_3_style );
  143.  
  144. }else{
  145.  
  146. print '<h2 class="text-center">Please Select Blog Post Layout Using Fixit &raquo; Theme Option &raquo; Custom Post Type &raquo; Blog Post Layout.</h2>';
  147. break;
  148. }
  149.  
  150. endwhile;
  151.  
  152. if( mh_get_option( Fixit_Factory::fixit_prefix() . 'blog_page_layout') === 'masonry-2-column-style' or
  153. mh_get_option( Fixit_Factory::fixit_prefix() . 'blog_page_layout') === 'masonry-3-column-style' ){
  154.  
  155. print '</div>';
  156. }else{ print '</div>'; }
  157.  
  158. print '<div class="row">';
  159. fixit_function_pagination( $wp_query->max_num_pages, "", $paged );
  160. print '</div>';
  161.  
  162. }else{ Fixit_Factory::fixit_content( 'none' ); }
  163.  
  164. get_template_part('inc/end','sidebar');
  165. get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement