<?php $options = _WSH()->option();
get_header();
$settings  = tycheproperty_set(tycheproperty_set(get_post_meta(get_the_ID(), 'bunch_page_meta', true) , 'bunch_page_options') , 0);
$meta = _WSH()->get_meta('_bunch_layout_settings');
$meta1 = _WSH()->get_meta('_bunch_header_settings');
if(tycheproperty_set($_GET, 'layout_style')) $layout = tycheproperty_set($_GET, 'layout_style'); else
$layout = tycheproperty_set( $meta, 'layout', 'full' );
$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-12 col-xs-12';
$title = tycheproperty_set($meta1, 'page_title');
$bg = tycheproperty_set($meta1, 'page_bg');
?>
<!--Page Title-->
<section class="page-title" <?php if($bg):?>style="background-image:url('<?php echo esc_url($bg);?>');"<?php endif;?>>
    <div class="auto-container">
        <div class="row clearfix">
            <!--Title -->
            <div class="title-column col-md-7 col-sm-6 col-xs-12">
                <h1><?php if($title) echo balanceTags($title); else wp_title('');?></h1>
            </div>
            <!--Bread Crumb -->
            <div class="breadcrumb-column col-md-5 col-sm-6 col-xs-12">
                <?php echo balanceTags(tycheproperty_get_the_breadcrumb());?>
            </div>
        </div>
    </div>
</section>

<!--Sidebar Page-->
<div class="sidebar-page-container">
    <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-6 col-xs-12">
                        <aside class="sidebar">
                            <?php dynamic_sidebar( $sidebar ); ?>
                        </aside>
                    </div>
                <?php }?>
		    <?php endif; ?>
            <!--Sidebar-->
            
            <!--Content Side-->	
            <div class="content-side <?php echo esc_attr($classes);?>">
                <section class="blog-news-section classic-view no-padd-bottom no-padd-top padd-right-40">
                    
                    <?php while( have_posts() ): the_post();?>
						
						<div class="post-content">
                    	<!-- blog post item -->
                        	<?php the_content(); ?>
                    	</div>    
                    	<!-- comment area -->
                    	<?php wp_link_pages(array('before'=>'<div class="paginate-links">'.esc_html__('Pages: ', 'tycheproperty'), 'after' => '</div>', 'link_before'=>'<span>', 'link_after'=>'</span>')); ?>
                    	<?php comments_template(); ?><!-- end comments -->
					<?php endwhile;?>
                    
                    <div class="styled-pagination text-center">
                        <ul class="pagination">
                            <?php tycheproperty_the_pagination(); ?>
                        </ul>
                    </div>
                    
                 </section>
            
            </div>
            <!--Content Side-->
            
            <!--Sidebar-->	
            <?php if( $layout == 'right' ): ?>
            	<?php if ( is_active_sidebar( $sidebar ) ) { ?>
                    <div class="col-lg-3 col-md-4 col-sm-6 col-xs-12">
                        <aside class="sidebar">
                            <?php dynamic_sidebar( $sidebar ); ?>
                        </aside>
                    </div>
                <?php }?>
		    <?php endif; ?>
            <!--Sidebar-->
            
        </div>
    </div>
</div>
<?php get_footer(); ?>