<?php
/**
 * The main template file
 *
 * This is the most generic template file in a WordPress theme
 * and one of the two required files for a theme (the other being style.css).
 * It is used to display a page when nothing more specific matches a query.
 * E.g., it puts together the home page when no home.php file exists.
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package Glaze_Blog_Lite
 */

get_header();
?>
<?php glaze_blog_lite_banner(); ?>
<div class="main-content-area-wrap">
	<div class="gb-container">
		<div class="row">
			<?php
			$sidebar_position = glaze_blog_lite_sidebar_position();
			if ( 'left' === $sidebar_position && is_active_sidebar( 'glaze-blog-lite-sidebar' ) ) {
				get_sidebar();
			}
			?>
			<div class="<?php glaze_blog_lite_main_container_class(); ?>">
				<div id="primary" class="primary-widget-area content-area">
					<main id="main" class="site-main">
						<?php
						if ( have_posts() ) {
							?>
							<div class="recent-posts-wrapper">
								<div class="posts-list-style-1">
									<?php
									while ( have_posts() ) {

										the_post();

										/**
										 * Include the Post-Type-specific template for the content.
										 * If you want to override this in a child theme, then include a file
										 * called content-___.php (where ___ is the Post Type name) and that will be used instead.
										 */
										get_template_part( 'template-parts/content' );
									}
									?>
								</div><!-- .posts-list-style-1 -->
							</div><!-- .recent-posts-wrapper -->
							<?php
							glaze_blog_lite_pagination();
						} else {

							get_template_part( 'template-parts/content', 'none' );
						}
						?>
					</main><!-- #main.site-main -->
				</div><!-- #primary.primary-widget-area.content-area -->
			</div><!-- .col -->
			<?php
			if ( 'right' === $sidebar_position && is_active_sidebar( 'glaze-blog-lite-sidebar' ) ) {
				get_sidebar();
			}
			?>
		</div><!-- .row -->
	</div><!-- .gb-container -->
</div><!-- .main-content-area-wrap -->
<?php
get_footer();
