<?php
$page_layout = Glamer_options('glamer_authors_layout', 'right-sidebar');
if ($page_layout == 'left-sidebar' && is_active_sidebar('sidebar') || $page_layout == 'right-sidebar' && is_active_sidebar('sidebar')) {
	$page_column_class = 'col-lg-8';
} else {
	$page_column_class = 'col-lg-12';
}
$show_pagination = Glamer_options('glamer_authors_pagination', true);
?>
<div class="row content-<?php echo esc_attr($page_layout); ?>">
	<?php if ($page_layout == 'left-sidebar' && is_active_sidebar('sidebar')) : ?>
		<?php get_sidebar(); ?>
	<?php endif ?>
	<div class="<?php echo esc_attr($page_column_class); ?>">
		<div class="row gy-40 all-posts-wrapper">
			<?php
			if (have_posts()) :

				if (is_home() && ! is_front_page()) :
			?>
					<header>
						<h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1>
					</header>
			<?php
				endif;

				while (have_posts()) :
					the_post();
					get_template_part('template-parts/post/post-item');

				endwhile;

			else :

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

			endif;
			?>
		</div>

		<?php
		if ($show_pagination == true) {
			get_template_part('template-parts/post/post-pagination');
		}
		?>
	</div>

	<?php if ($page_layout == 'right-sidebar' && is_active_sidebar('sidebar')) : ?>
		<?php get_sidebar(); ?>
	<?php endif ?>
</div>