I'm creating custom numbered pagination for custom taxonomy archive page. So, I have no problem with displaying pagination, with proper links display, etc.
However, when I click a link above page number 2 (e.g. page 3, like:
my-website.com/page/3/?my_category=some-term
i get 404 - page does not exist.
The category contains over 60 posts, and there should be 8 pages, but only the first and second one are displayed properly
my-website.com/?my_category=some-term
and
my-website.com/page/2/?my_category=some-term
but everything above this gives 404.
This is my WP_Query in this taxonomy template:
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$qobj = get_queried_object();
$args = array(
'posts_per_page' => 8,
'orderby' => 'title',
'tax_query' => array(
array(
'taxonomy' => $qobj->taxonomy,
'field' => 'id',
'terms' => $qobj->term_id
)
),
'paged' => $paged
);
and
$wp_query = new WP_Query( $args );