<?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.
 *
 * FIXED (see chat notes): this file previously had index.php's blog-loop
 * code pasted inside it instead of calling the_content(). That meant no
 * WordPress Page ever rendered its real content/shortcodes -- including
 * FluentCart's Cart and Checkout pages, which are just normal Pages with
 * [fluent_cart_cart] / [fluent_cart_checkout] shortcodes in them.
 *
 * @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-<?php print esc_attr( $blog_column );?>  col-lg-<?php print esc_attr( $blog_column );?> col-md-12">
					<?php
					if ( have_posts() ) :

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

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

							if ( comments_open() || get_comments_number() ) :
								comments_template();
							endif;

						endwhile;

					endif;
					?>
				</div>

				<?php if(class_exists('kirki') && $tsp_blog_sidebar == 'right'){ ?>
					<div class="blog-sidebar mb-5 mt-lg-0">
						<?php echo get_sidebar();?>
					</div>
				<?php }  ?>
			</div>
		</div>
	</main>
</div>

<?php

get_footer();
