<?php
/**
 * The template for displaying archive pages
 *
 */

get_header();
$container = get_theme_mod('bexplore_container_type', 'container');
?>

    <main id="primary" class="site-main">

        <div class="<?php echo esc_attr($container); ?>">
            <div class="row">
                <!-- Do the left sidebar check and opens the primary div -->
                <?php get_template_part('global-templates/left-sidebar-check'); ?>

                <?php if (have_posts()) : ?>
                    <?php if (bexplore_breadcrumb_show()): ?>
                        <header class="page-header">
                            <?php
                            the_archive_title('<h1 class="page-title">', '</h1>');
                            the_archive_description('<div class="archive-description">', '</div>');
                            ?>
                        </header><!-- .page-header -->
                    <?php endif;
                    /* Start the Loop */
                ?>
                <div class="bexplore-masonry-grid">
                    <div class="bexplore-masonry-sizer"></div>
                    <div class="bexplore-masonry-gutter"></div>
                    <?php
                    while (have_posts()) :
                        the_post();

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

                    endwhile;
                    ?>
                </div>
                    <?php
                    get_template_part('template-parts/pagination');

                else :

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

                endif;
                ?>
                <!-- Do the left sidebar check and opens the primary div -->
                <?php get_template_part('global-templates/right-sidebar-check'); ?>
            </div>
        </div>
    </main><!-- #main -->

<?php

get_footer();
