<?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');
$meta2 = _WSH()->get_meta();
_WSH()->page_settings = $meta;
if(tycheproperty_set($_GET, 'layout_style')) $layout = tycheproperty_set($_GET, 'layout_style'); else
$layout = tycheproperty_set( $meta, 'layout', 'right' );
if( !$layout || $layout == 'full' || tycheproperty_set($_GET, 'layout_style')=='full' ) $sidebar = ''; else
$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 ' ;
/** Update the post views counter */
_WSH()->post_views( true );
$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">
            <?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 padd-right-50 <?php echo esc_attr($classes);?>">
                <!--Blog News Section-->
                
                <?php while( have_posts() ): the_post(); 
                    $post_meta = _WSH()->get_meta();
                ?>
                
                <!--Blog Section / Classic View-->
                <section class="blog-news-section classic-view blog-detail no-padd-bottom no-padd-top row">
                    
                    <!--BLog News Column-->
                    <div class="blog-news-column">
                        <div class="inner-box">
                            <?php if(has_post_thumbnail()):?>
                            <figure class="image-box"><a href="<?php echo esc_url(get_permalink(get_the_id()));?>"><?php the_post_thumbnail('1170x425', array('class' => 'img-responsive'));?></a></figure>
                            <?php endif;?>
                            <div class="post-content">
                                <div class="post-tags"><?php the_tags('', ' , ', '');?></div>
                                <div class="text">
                                    <?php the_content();?>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                </section>
                
                <!--Author Info-->
                <?php if(get_the_author_meta('description')):?>
				<div class="author-box">
                    <div class="inner">
                        <figure class="image"><?php echo get_avatar('', 180 ); ?></figure>
                        <h3><?php the_author();?></h3>
                        <div class="text"><?php echo '“ ';the_author_meta( 'description', get_the_author_meta('ID') ); echo '”';?></div>
                        <div class="social-links">
                            <?php if($value = get_the_author_meta('facebook') ): ?>
                            <a href="<?php echo esc_url($value); ?>"><span class="fa fa-facebook-f"></span></a>
                            <?php endif; ?>
                            <?php if($value = get_the_author_meta('twitter') ): ?>
                            <a href="<?php echo esc_url($value); ?>"><span class="fa fa-twitter"></span></a>
                            <?php endif; ?>
                            <?php if($value = get_the_author_meta('googleplus') ): ?>
                            <a href="<?php echo esc_url($value); ?>"><span class="fa fa-google-plus"></span></a>
                            <?php endif; ?>
                            <?php if($value = get_the_author_meta('linkedin') ): ?>
                            <a href="<?php echo esc_url($value); ?>"><span class="fa fa-linkedin"></span></a>
                            <?php endif; ?>
                        </div>
                    </div>
                </div>
				<?php endif;?>
                <!-- Comment Form -->
                <?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>
            
            <!--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(); ?>