<?php
/**
 * The template for displaying Category pages
 */

get_header();

global $restorator_options;

$restorator_sidebar_layout = isset( $restorator_options['blog_layout'] ) ? $restorator_options['blog_layout'] : 'right-sidebar';
if( $restorator_sidebar_layout == 'left-sidebar' ) {
	$restorator_sidebar_class = 'pull-left ';
	$restorator_blog_list_wrap_class = 'left_sidebar ';
	$restorator_blog_list_class = 'col-md-8 pull-right';
} elseif( $restorator_sidebar_layout == 'right-sidebar' ) {
	$restorator_sidebar_class = 'pull-right';
	$restorator_blog_list_wrap_class = 'right_sidebar ';
	$restorator_blog_list_class = 'col-md-8 pull-left ';
} else {
	$restorator_sidebar_class = $restorator_blog_list_class = '';
	$restorator_blog_list_wrap_class = 'no_sidebar ';
}
?>
		
		<div id="blog_list" class="container default mt0 <?php echo esc_html( $restorator_blog_list_wrap_class ); ?>">
			<div class="row">
			
			<?php
			if( $restorator_sidebar_layout != 'no-sidebar' ) {
			echo '
				<div class="' . esc_html( $restorator_blog_list_class ) . '">
					<div class="row">
				';
			}
			?>

						<?php
							while (have_posts()) {
								the_post();
						?>
								
								<article id="post-<?php the_ID(); ?>" <?php post_class('col-md-12'); ?>>
									
									<?php get_template_part('templates/blog/loop'); ?>
									
								</article>
								
						<?php 
							}
						?>
					
			<?php
			if( $restorator_sidebar_layout != 'no-sidebar' ) {
			echo '
					</div>';
					
					echo restorator_pagination( $pages = '' );
					
				echo '
				</div>
				';
			}
			?>
				
				<?php if( $restorator_sidebar_layout != 'no-sidebar' ) { ?>
					<div class="col-md-4 <?php echo esc_html( $restorator_sidebar_class ); ?>">
						<?php get_sidebar(); ?>
					</div>
				<?php } ?>
				
				<?php if( $restorator_sidebar_layout == 'no-sidebar' ) { ?>
					<?php echo restorator_pagination( $pages = '' ); ?>
				<?php } ?>
				
			</div>
			
		</div>

<?php get_footer(); ?>