i've created a custom taxonomy template for my taxonomy and custom post type,
custom post type name is "ecommerce" custom taxonomy is "ecommerce_categories", the problem is with the pagination it shows correctly that there are 2 pages with posts inside it but when i click on page 2 i get 404 page, this happens only when i'm on the taxonomy page, i've also created a custom page template that does the same as the taxonomy file and the pagination works here (on the custom page template) the problem is only when i'm on the taxonomy category page. This is the code of the file taxonomy-ecommerce_categories.php
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$term = $wp_query->queried_object;
$shop_loop = new WP_Query( array( 'post_type' => 'ecommerce', 'ecommerce_categories' => $term->name, 'posts_per_page' => 2, 'orderby' => 'menu_order', 'paged'=>$paged ) ); ?>
<?php while ( $shop_loop->have_posts() ) : $shop_loop->the_post(); ?>
// here is my loop code with divs links etc.. etc...
<?php endwhile;?>
<div class="clearfix"></div>
<?php if(function_exists('wp_pagenavi')) { wp_pagenavi( array( 'query' => $shop_loop ) ); } ?>
I see the pagination but when i click on page 2 or page 3 i get 404 error page this happen with any permalink setting and also if i change the pagination from the wp pagenavi plugin to the wordpress default one using this code
<?php wp_link_pages(); ?> or previous_post_link and next_post_link
i can't see it nothing is displayed below posts.
How can i fix this ? what i'm doing wrong ?