<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'posts_per_page' => 6,
'order' => 'DESC',
'post_type' => 'product',
'paged' => $paged
);
$loop = new WP_Query( $args );
if ( $loop->have_posts() ) :
while ( $loop->have_posts() ) : $loop->the_post(); ?>
<?php the_title(); ?>
<?php endwhile;
endif; ?>
<!-- Pagination -->
<div class="page_nav">
<?php
$GLOBALS['wp_query']->max_num_pages = $loop->max_num_pages;
the_posts_pagination(array(
'type'=>'inline',
'screen_reader_text' => __( '' ),
'end_size' => 1,
'mid_size' => 1,
'prev_next' => True,
'prev_text' => __('<i class="fa fa-angle-left"></i>'),
'next_text' => __('<i class="fa fa-angle-right"></i>'),
'add_args' => False
));
?>
</div>
<?php wp_reset_postdata(); ?>
<!-- End Pagination -->