<?php $options = _WSH()->option();
	get_header(); 
	$settings  = buildark_set(buildark_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(buildark_set($_GET, 'layout_style')) $layout = buildark_set($_GET, 'layout_style'); else
	$layout = buildark_set( $meta, 'layout', 'full' );
	if( !$layout || $layout == 'full' || buildark_set($_GET, 'layout_style')=='full' ) $sidebar = ''; else
	$sidebar = buildark_set( $meta, 'sidebar', 'blog-sidebar' );
	$classes = ( !$layout || $layout == 'full' || buildark_set($_GET, 'layout_style')=='full' ) ? ' col-lg-12 col-md-12 col-sm-12 col-xs-12 ' : ' content-side col-lg-8 col-md-8 col-sm-12 col-xs-12 ' ;
	/** Update the post views counter */
	_WSH()->post_views( true );
	$title = buildark_set($meta1, 'header_title');
	$desc = buildark_set($meta1, 'header_desc');
?>
<!--Page Title-->
<section class="page-title">
	<div class="auto-container">
		<h1><?php if($title) echo wp_kses_post($title); else wp_title('');?></h1>
		<div class="text"><?php echo wp_kses_post( $desc );  ?></div>
	</div>
</section>
<!--End Page Title-->

<!--Page Info-->
<section class="page-info">
	<div class="auto-container">
		<?php echo wp_kses_post(buildark_get_the_breadcrumb()) ?>
	</div>
</section>
<!--End Page Info-->

<!--Sidebar Page-->
<div class="sidebar-page-container">
    <div class="auto-container">
        <div class="row clearfix">
            
            <!-- sidebar area -->
			<?php if( $layout == 'left' ): ?>
			<?php if ( is_active_sidebar( $sidebar ) ) { ?>
			<div class="sidebar-side col-lg-4 col-md-4 col-sm-12 col-xs-12">        
				<aside class="sidebar default-sidebar">
					<?php dynamic_sidebar( $sidebar ); ?>
				</aside>
            </div>
			<?php } ?>
			<?php endif; ?>
            
            <!--Content Side-->	
            <div class="<?php echo esc_attr($classes);?>">
                <div class="thm-unit-test">
                    <!--Default Section-->
                    <?php while( have_posts() ): the_post();
                        global $post; 
                        $post_meta = _WSH()->get_meta();
                        buildark_bunch_setPostViews( get_the_ID() );
                    ?>
				
                	<div class="blog-single-two">

						<!--News Block Three-->
                        <div class="news-style-two">
                            <div class="inner-box">
                                <?php if(has_post_thumbnail()):?>
                                <div class="image">
                                    <?php the_post_thumbnail( 'buildark_1170x430', array( 'class' => 'img-responsive' ) );?>
                                </div>
                                <?php endif;?>
                                
                                <div class="lower-content <?php if(! has_post_thumbnail() == true) echo 'pt-0';?>">
                                    <div class="upper-box clearfix">
                                        <div class="posted-date"><?php echo get_the_date(''); ?></div>
                                        <ul class="post-meta">
                                            <li><?php esc_html_e( 'By:', 'buildark' ); ?> <?php the_author();?></li>
                                            <li><?php comments_number( wp_kses_post(__('Comment: 0' , 'buildark')), wp_kses_post(__('Comment: 1' , 'buildark')), wp_kses_post(__('Comments: %' , 'buildark'))); ?></li>
                                        </ul>
                                    </div>
                                    <div class="lower-box">
                                        <div class="text">
                                        	<?php the_content(); ?>
                                            <div class="clearfix"></div>
                                            <?php wp_link_pages(array('before'=>'<div class="paginate-links">'.esc_html__('Pages: ', 'buildark'), 'after' => '</div>', 'link_before'=>'<span>', 'link_after'=>'</span>')); ?>
                                        </div>
                                    </div>
                                    
                                </div>
                            </div>
                        </div>
                        
						<?php comments_template(); ?><!-- end comments -->    
                        
                        <!--Posts Nav-->
                        <div class="posts-nav">
                            <div class="clearfix">
                                <div class="pull-left">
                                    <?php previous_post_link('%link','<div class="prev-post"><span class="fa fa-long-arrow-left"></span> &nbsp;&nbsp;&nbsp; Prev Post</div>'); ?>
                                </div>
                                <div class="pull-right">
                                    <?php next_post_link('%link','<div class="next-post">Next Post &nbsp;&nbsp;&nbsp; <span class="fa fa-long-arrow-right"></span> </div>'); ?>
                                </div>                                
                            </div>
                        </div>
                        
					</div>
				
					<?php endwhile;?>	
                
                </div>
            </div>
            <!--Content Side-->
            
            <!-- sidebar area -->
			<?php if( $layout == 'right' ): ?>
			<?php if ( is_active_sidebar( $sidebar ) ) { ?>
			<div class="sidebar-side col-lg-4 col-md-4 col-sm-12 col-xs-12">        
				<aside class="sidebar default-sidebar">
					<?php dynamic_sidebar( $sidebar ); ?>
				</aside>
            </div>
			<?php } ?>
			<?php endif; ?>
        </div>
    </div>
</div>

<?php get_footer(); ?>