<?php tycheproperty_bunch_global_variable(); 
$options = _WSH()->option();
get_header();
$view = '';
$settings  = _WSH()->option(); 
if(tycheproperty_set($_GET, 'layout_style')) $layout = tycheproperty_set($_GET, 'layout_style'); else
$layout = tycheproperty_set( $settings, 'author_page_layout', 'right' );
$sidebar = tycheproperty_set( $settings, 'author_page_sidebar', 'blog-sidebar' );
_WSH()->page_settings = array('layout'=>$layout, 'view'=> $view, 'sidebar'=>$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($options, 'author_title');
$bg = tycheproperty_set($options, 'author_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();?>
						<!--Blog Post-->
                        <div id="post-<?php the_ID(); ?>" <?php post_class();?>>
                            <?php get_template_part( 'blog' ); ?>
                        </div>
                    <?php endwhile;?>
                    
                    <!--Pagination-->
                    <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(); ?>