Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Post Page Template ( index.php ).
- */
- global $wp_query, $post;
- get_header();
- get_template_part('page_banner');
- get_template_part('inc/start','sidebar');
- $paged = get_query_var('paged') ? get_query_var('paged') : (int) absint('1');
- $counter_1_large_then_3_grid_style = '-1';
- $counter_1_masonry_3 = (int) absint('0');
- $fixit_blog_counter = $counter_1_large_then_2_grid_style = $counter_1_large_then_list_style = (int) absint('1');
- if ( have_posts() ){
- if( mh_get_option( Fixit_Factory::fixit_prefix() . 'blog_page_layout') === 'masonry-2-column-style' or
- mh_get_option( Fixit_Factory::fixit_prefix() . 'blog_page_layout') === 'masonry-3-column-style' ){
- print '<div id="isotope" class="grid row">';
- }else{ print '<div class="row">'; }
- while ( have_posts() ) : the_post();
- if( mh_get_option( Fixit_Factory::fixit_prefix() . 'blog_page_layout') === 'blog-list-column' ){
- print '<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 blog-post post-block">';
- Fixit_Factory::fixit_content( 'list' );
- print '</div>';
- }elseif( mh_get_option( Fixit_Factory::fixit_prefix() . 'blog_page_layout') === '1-large-then-2-grid-style' ){
- $class_1_large_then_2_grid_style = '';
- 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';
- if( (int) absint( $fixit_blog_counter ) === (int) (absint('1')) ){
- print '<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 blog-post">';
- }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 .'">'; }
- Fixit_Factory::fixit_content( 'content' );
- print '</div>'; $fixit_blog_counter++; unset( $class_1_large_then_2_grid_style ); $counter_1_large_then_2_grid_style++;
- }elseif( mh_get_option( Fixit_Factory::fixit_prefix() . 'blog_page_layout') === '1-large-then-3-grid-style' ){
- $class_1_large_then_3_grid_style = '';
- 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';
- if( $counter_1_large_then_3_grid_style % (int) absint('2') === absint('0') ) $class_1_large_then_3_grid_style .= ' col-sm-clearboth';
- if( (int) absint( $fixit_blog_counter ) === (int) (absint('1') ) ){
- print '<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 blog-post">';
- }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 .'">'; }
- Fixit_Factory::fixit_content( 'content' );
- print '</div>';
- $fixit_blog_counter++; $counter_1_large_then_3_grid_style++; unset( $class_1_large_then_3_grid_style );
- }elseif( mh_get_option( Fixit_Factory::fixit_prefix() . 'blog_page_layout') === '1-large-then-list-style' ){
- if( $fixit_blog_counter === (int)(absint('1')) ){
- print '<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 blog-post">'; Fixit_Factory::fixit_content( 'content' );
- }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' ); }
- print '</div>'; $fixit_blog_counter++;
- }elseif( mh_get_option( Fixit_Factory::fixit_prefix() . 'blog_page_layout') === 'masonry-2-column-style' ){
- $masonry_3_style = '';
- if( $counter_1_masonry_3 % (int) absint('2') === absint('0') ) $masonry_3_style .= 'col-lg-clearboth col-md-clearboth col-sm-clearboth';
- print '<div class="grid-item col-lg-6 col-md-6 col-sm-6 col-xs-12 blog-post '. $masonry_3_style .'">';
- Fixit_Factory::fixit_content( 'content' );
- print '</div>';
- $counter_1_masonry_3++; unset( $masonry_3_style );
- }elseif( mh_get_option( Fixit_Factory::fixit_prefix() . 'blog_page_layout') === 'masonry-3-column-style' ){
- $masonry_3_style = '';
- if( $counter_1_masonry_3 % (int) absint('3') === absint('0') ) $masonry_3_style .= ' col-lg-clearboth col-md-clearboth';
- if( $counter_1_masonry_3 % (int) absint('2') === absint('0') ) $masonry_3_style .= ' col-sm-clearboth';
- print '<div class="grid-item col-lg-4 col-md-4 col-sm-6 col-xs-12 blog-post '. $masonry_3_style .'">';
- Fixit_Factory::fixit_content( 'content' );
- print '</div>';
- $counter_1_masonry_3++; unset( $masonry_3_style );
- }elseif( mh_get_option( Fixit_Factory::fixit_prefix() . 'blog_page_layout') === 'blog-large-image-style' ){
- print '<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 blog-post">';
- Fixit_Factory::fixit_content( 'content' );
- print '</div>';
- }elseif( mh_get_option( Fixit_Factory::fixit_prefix() . 'blog_page_layout') === 'blog-simple-two-column-style' ){
- $masonry_3_style = '';
- if( $counter_1_masonry_3 % (int) absint('2') === absint('0') ) $masonry_3_style .= 'col-lg-clearboth col-md-clearboth col-sm-clearboth';
- print '<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 blog-post '. $masonry_3_style .'">';
- Fixit_Factory::fixit_content( 'content' );
- print '</div>';
- $counter_1_masonry_3++; unset( $masonry_3_style );
- }elseif( mh_get_option( Fixit_Factory::fixit_prefix() . 'blog_page_layout') === 'blog-simple-three-column-style' ){
- $masonry_3_style = '';
- if( $counter_1_masonry_3 % (int) absint('3') === absint('0') ) $masonry_3_style .= ' col-lg-clearboth col-md-clearboth';
- if( $counter_1_masonry_3 % (int) absint('2') === absint('0') ) $masonry_3_style .= ' col-sm-clearboth';
- print '<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12 blog-post '. $masonry_3_style .'">';
- Fixit_Factory::fixit_content( 'content' );
- print '</div>';
- $counter_1_masonry_3++; unset( $masonry_3_style );
- }else{
- print '<h2 class="text-center">Please Select Blog Post Layout Using Fixit » Theme Option » Custom Post Type » Blog Post Layout.</h2>';
- break;
- }
- endwhile;
- if( mh_get_option( Fixit_Factory::fixit_prefix() . 'blog_page_layout') === 'masonry-2-column-style' or
- mh_get_option( Fixit_Factory::fixit_prefix() . 'blog_page_layout') === 'masonry-3-column-style' ){
- print '</div>';
- }else{ print '</div>'; }
- print '<div class="row">';
- fixit_function_pagination( $wp_query->max_num_pages, "", $paged );
- print '</div>';
- }else{ Fixit_Factory::fixit_content( 'none' ); }
- get_template_part('inc/end','sidebar');
- get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement