<?php
/**
 * The template for displaying all pages
 *
 * This is the template that displays all pages by default.
 * Please note that this is the WordPress construct of pages
 * and that other 'pages' on your WordPress site may use a
 * different template.
 *
 * @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','no'); 

// $blog_column = ($tsp_blog_sidebar == 'no' || !is_active_sidebar('blog-sidebar')) ? '12' : '8 ';

$blog_column = is_active_sidebar( 'blog-sidebar' ) ? 8 : 12;

?>

<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="blog-sidebar mb-5 mt-lg-0">
						<?php echo get_sidebar();?>
					</div>
				<?php }  ?>
				
				<div class="col-xl-12  col-lg-<?php print esc_attr( $blog_column );?> col-md-12">
				
					<?php
					while ( have_posts() ) :
						the_post();

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


						// If comments are open or we have at least one comment, load up the comment template.
						if ( comments_open() || get_comments_number() ) :
							comments_template();
						endif;

					endwhile; // End of the loop.
					?>			

				</div><!-- End Col -->
				
				<?php if( is_active_sidebar( 'blog-sidebar' ) ) {?>
					<div class="col-lg-4 col-xl-4">
						<div class="blog-sidebar mt-5 mt-lg-0">
							<?php get_sidebar();?>
						</div>
					</div>
				<?php } ?> 
		
		
		</div>
	</main>
</div>

<?php

get_footer();
