<?php
/**
* Template Name: Home Page
*/
get_header();

$edify_hide_banner = get_theme_mod( 'front_banner_layout', true);


$tsp_blog_sidebar = get_theme_mod('blog_sidebar','right'); 
$blog_column = ($tsp_blog_sidebar == 'no' || !is_active_sidebar('blog-sidebar')) ? '12' : '8  mx-auto';

$banner_img = get_template_directory_uri() . '/assets/images/logo.png';

$banner_img = get_theme_mod( 'front_banner_img', $banner_img );


?>
<?php if($edify_hide_banner == true){ ?>
	
	<div class="front-banner-section section-padding">
		<div class="container">
			<div class="row align-items-center">
				<div class="col-xl-7 col-lg-7">
					<div class="banner-content">
						<h1>A Hub for WordPress Block Editor, Gutenberg</h1>
						<p>Gutenberg Hub is a great place to learn about the WordPress Block Editor. It offers tutorials, tips, blocks, patterns, and more resources. You can also buy premium Blocks and patterns, and other Gutenberg goodness to enhance your website.</p>
					</div>
				</div>
				<div class="col-xl-5 col-lg-5">
					<div class="banner-img">
						<img src="<?php echo esc_url($banner_img );?>" alt="<?php bloginfo('name'); ?>">
					</div>
				</div>
			</div>
		</div>
	</div>

<?php 
}

?>



<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 echo 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_format() );

							endwhile;

						edify_post_pagination();

						else :

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

						endif;
						?>				

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

<?php

get_footer();