<?php
    $nb_layout = nimbus_option_data('select_archive_post_type');
    $nb_wrap_layout = nimbus_option_data('select_archive_layout');
    $nb_col = nimbus_option_data('select_archive_columns');
    $nb_col = $nb_layout == 'large' ? 12 : $nb_col;
    $nb_content_width = $nb_wrap_layout == 'fullwidth' ? 12 : 8;
    get_header();
    get_template_part('template_part/site/heading');
    wp_enqueue_script('masonry');
?>
<div class="nb-large-padding nb-section">
    <div class="nb-container">
        <div class="nb-row <?php echo esc_attr($nb_wrap_layout);?>">
            <div id="content" class="nb-col-md-<?php echo esc_attr( $nb_content_width );?>">
                <?php if ( have_posts() ) : ?>
                    <div class="nb-row nb-layout-<?php echo esc_attr($nb_layout);?>">
                    <?php while ( have_posts() ) : the_post(); ?>
                        <div class="nb-col-md-<?php echo esc_attr($nb_col);?> nb-col-sm-<?php echo esc_attr($nb_col);?>">
                        <?php get_template_part( 'template_part/content/blog-grid' ); ?>
                        </div>
                    <?php endwhile; ?>
                    </div>
                    <?php the_posts_pagination( array(
                        'prev_text'          => esc_attr__( 'Previous page', 'nimbus' ),
                        'next_text'          => esc_attr__( 'Next page', 'nimbus' ),
                        'before_page_number' => '<span class="meta-nav screen-reader-text">' . esc_attr__( 'Page', 'nimbus' ) . ' </span>',
                    ) );
                    else:
                        get_template_part( 'template_part/content/none' );
                endif;?>
            </div>
            <?php if( $nb_content_width == 8 ) get_sidebar(); ?>
        </div>
    </div>
</div>
<?php get_footer();?>