<?php
/**
 * The template for displaying archive pages
 *
 * Learn more: https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package Poster
 */

// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;

get_header();

$postsstyle = get_theme_mod( 'poster_posts_layout', 'poster');
$container = get_theme_mod( 'poster_container_type' );
?>

<div class="wrapper" id="archive-wrapper">

	<div class="<?php echo esc_attr( $container ); ?>" id="content" tabindex="-1">

		<div class="row">
			<?php	// Do the left sidebar check and open div#primary.
			get_template_part( 'global-templates/left-sidebar-check' );
			?>
		<main class="site-main" id="main">
			<?php 
				if (is_active_sidebar('archive-before-posts')) {
					dynamic_sidebar('archive-before-posts');
				} ?>			
				<?php get_template_part( 'loop-templates/posts/posts', $postsstyle ); ?>
			</main>
			<?php
			// Display the pagination component.
			poster_pagination();

			// Do the right sidebar check and close div#primary.
			get_template_part( 'global-templates/right-sidebar-check' );
			?>

		</div><!-- .row -->

	</div><!-- #content -->

</div><!-- #archive-wrapper -->

<?php
get_footer();
