<?php
/**
 * The template for displaying archive pages
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package Edify
 */

get_header();

get_template_part( 'template-parts/banner/banner-page');

$tsp_blog_sidebar = get_theme_mod('page_sidebar','right'); 

$blog_column = ($tsp_blog_sidebar == 'no' || !is_active_sidebar('sidebar-1')) ? '12' : '8  mx-auto';
?>

<div class="page-wrapper">
	<main id="main" class="site-main">
		<div class="container">
			<div class="row justify-content-center">
				<?php if(class_exists('kirki') && $tsp_blog_sidebar == 'left'){ ?>
					<div class="col-lg-4 col-xl-4">
						<div class="blog-sidebar mb-5 mt-lg-0">
							<?php get_sidebar();?>
						</div>
					</div>
				<?php }  ?>

				<div class="col-xl-<?php print esc_attr( $blog_column );?>  col-lg-<?php print esc_attr( $blog_column );?> col-md-12">
					<div class="row">
						<?php
						if ( have_posts() ) :

							/* Start the Loop */
							while ( have_posts() ) :
								the_post();

								get_template_part( 'template-parts/content', get_post_type() );

							endwhile;

						edify_post_pagination();

						else :

							get_template_part( 'template-parts/content', 'none' );

						endif;
						?>				

					</div>
					
				</div>
				
				<?php if(is_active_sidebar( 'sidebar-1') && $tsp_blog_sidebar == 'right'):?>
					<div class="col-lg-4 col-xl-4">
						<div class="blog-sidebar mt-5 mt-lg-0">
							<?php get_sidebar();?>
						</div>
					</div>
				<?php endif;?>
			</div>
		</div>
	</main>
</div>


<?php

get_footer();
