<?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');
	if(buildark_set($_GET, 'layout_style')) $layout = buildark_set($_GET, 'layout_style'); else
	$layout = buildark_set( $meta, 'layout', 'full' );
	$sidebar = buildark_set( $meta, 'sidebar', 'default-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 ' ;
	$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 endif; ?>
			<?php endif; ?>
            
            <!--Content Side-->	
            <div class="<?php echo esc_attr($classes);?>">
                
                <!--Blog Post-->
                <div class="blog-classic">
                    <div class="thm-unit-test">
                    <?php while( have_posts() ): the_post();?>
                       <div class="news-style-two text">
                            <!-- blog post item -->
							<?php the_content(); ?>
                            <div class="clearfix"></div>
                            <?php comments_template(); ?><!-- end comments -->
                            
                            <?php wp_link_pages(array('before'=>'<div class="paginate-links mt-50">'.esc_html__('Pages: ', 'buildark'), 'after' => '</div>', 'link_before'=>'<span>', 'link_after'=>'</span>')); ?>
                            <!--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>
                        <!--Pagination-->
                        <div class="styled-pagination">
                            <?php buildark_the_pagination(); ?>
                        </div>
                    <?php endwhile;?>
                    </div>
                </div>
            </div>
            <!--Content Side-->
            
            <!--Sidebar-->	
            <!-- 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 endif; ?>
			<?php endif; ?>
            <!--Sidebar-->
            
        </div>
    </div>
</div>

<?php get_footer(); ?>