<?php tycheproperty_bunch_global_variable();
$options = _WSH()->option();
get_header();
$view = '';
$style2 = ''; 
$meta = _WSH()->get_term_meta( '_bunch_category_settings' );
_WSH()->page_settings = $meta;
if(tycheproperty_set($meta, 'cat_blog_style')=='blog_style2' || tycheproperty_set($_GET, 'blog_style') == 'blog_style2' ) $style2 = 'blog_style2'; 
if(tycheproperty_set($_GET, 'layout_style')) $layout = tycheproperty_set($_GET, 'layout_style'); else
$layout = tycheproperty_set( $meta, 'layout', 'right' );
$sidebar = tycheproperty_set( $meta, 'sidebar', 'blog-sidebar' );
$classes = ( !$layout || $layout == 'full' || tycheproperty_set($_GET, 'layout_style')=='full' ) ? ' col-lg-12 col-md-12 col-sm-12 col-xs-12 ' : ' col-lg-9 col-md-8 col-sm-7 col-xs-12 ' ;
  
$title = tycheproperty_set($meta, 'cat_title');
?>
<!--Page Title-->
<section class="page-title">
	<div class="auto-container">
		<div class="content-box">
			<h1><?php if($title) echo balanceTags($title); else wp_title('');?></h1>
			<div class="bread-crumb">
				<?php echo balanceTags(tycheproperty_get_the_breadcrumb());?>
			</div>
		</div>
	</div>
</section>
<!--Sidebar Page-->
<div class="sidebar-page">
    <div class="auto-container">
    	<div class="row clearfix">
            <!--Sidebar-->	
            <?php if( $layout == 'left' ): ?>
            
				<?php if ( is_active_sidebar( $sidebar ) ) { ?>
                    <div class="col-lg-3 col-md-4 col-sm-5 col-xs-12">
                        <aside class="sidebar">
                            <?php dynamic_sidebar( $sidebar ); ?>
                        </aside>
                    
                    </div>
                <?php }?>
		    <?php endif; ?>
            <!--Sidebar-->
            
            <!--Content Side-->	
            <div class="<?php echo esc_attr($classes);?>">
                <section class="blog-container<?php if($style2) echo ' two-col';?>">
                    
                    <?php while( have_posts() ): the_post();?>
					<?php if($style2):?>
						<!--Blog Post-->
						<div class="col-md-6 col-sm-12 col-xs-12 blog-post wow fadeInLeft" data-wow-delay="0ms" data-wow-duration="1500ms">
							<div id="post-<?php the_ID(); ?>" <?php post_class();?>>
								<?php get_template_part( 'blog', 'twocolumn' ); ?>
								<!-- blog post item -->
							</div><!-- End Post -->
						</div>
					<?php else:?>
						<!--Blog Post-->
                        <div id="post-<?php the_ID(); ?>" <?php post_class();?>>
                            <?php get_template_part( 'blog' ); ?>
                        </div>
					<?php endif;?>
                    <?php endwhile;?>
                    
                 </section>
                
                <br>
                <!--Pagination-->
                <div class="pager-outer">
                	<ul class="pagination">
                    	<?php tycheproperty_the_pagination(); ?>
                    </ul>
                </div>
            
            </div>
            <!--Content Side-->
            
            <!--Sidebar-->	
            <?php if( $layout == 'right' ): ?>
            
				<?php if ( is_active_sidebar( $sidebar ) ) { ?>
                    <div class="col-lg-3 col-md-4 col-sm-5 col-xs-12">
                        <aside class="sidebar">
                            <?php dynamic_sidebar( $sidebar ); ?>
                        </aside>
                    
                    </div>
                <?php }?>
		    <?php endif; ?>
            <!--Sidebar-->
            
        </div>
    </div>
</div>
<?php get_footer(); ?>