<?php
$classes   = array( 'post-item' );
$classes[] = 'col-' . Draly_Dropshipping_Starter_Helper::get_option( 'blog_items', 12 );
$classes[] = 'col-sm-' . Draly_Dropshipping_Starter_Helper::get_option( 'blog_sm_items', 12 );
$classes[] = 'col-md-' . Draly_Dropshipping_Starter_Helper::get_option( 'blog_md_items', 6 );
$classes[] = 'col-lg-' . Draly_Dropshipping_Starter_Helper::get_option( 'blog_lg_items', 4 );
$classes[] = 'col-xl-' . Draly_Dropshipping_Starter_Helper::get_option( 'blog_xl_items', 4 );
$classes[] = 'col-xxl-' . Draly_Dropshipping_Starter_Helper::get_option( 'blog_xxl_items', 4 );

if ( have_posts() ) : ?>
    <div class="blog-grid row">
		<?php while ( have_posts() ) : the_post(); ?>
            <article <?php post_class( $classes ); ?>>
				<?php get_template_part( '/templates/blog/blog-style/content-blog', 'style-01' ); ?>
            </article>
		<?php endwhile;
		wp_reset_postdata(); ?>
    </div>
	<?php
	global $wp_query;
	$max = $wp_query->max_num_pages;
	// Don't print empty markup if there's only one page.
	if ( $max >= 2 ) {
		echo wp_kses_post( get_the_posts_pagination(
			array(
				'screen_reader_text' => '&nbsp;',
				'before_page_number' => '',
				'prev_text'          => '<span class="fa fa-angle-left"></span>',
				'next_text'          => '<span class="fa fa-angle-right"></span>',
			)
		) );
	}
	?>
<?php else :
	get_template_part( 'content', 'none' );
endif;