I finally found a fix:
just need to replace this:
the_posts_pagination( array( 'mid_size' => 2 ) );
with:
echo paginate_links( array(
'total' => $query->max_num_pages,
'mid_size' => 2
));
I finally found a fix:
just need to replace this:
the_posts_pagination( array( 'mid_size' => 2 ) );
with:
echo paginate_links( array(
'total' => $query->max_num_pages,
'mid_size' => 2
));