this is my query:
$p_query = new WP_Query(array( 'post_type' => $post_type ,'post_status' => 'publish' ,'posts_per_page' => $per_page // 6 ,'paged' => $page // 2 ,'post__not_in' => array($first_post) // an ID ,'tax_query' => array( array( 'taxonomy' => $data['tax'] // tax slug ,'field' => 'slug' ,'terms' => $data['term'] // term slug ) ) ));
Pagination works properly without the tax_query. As soon as I add it, on page 2 something strange happens:
it returns the correct number of items (the remaining number of items)
the items are wrong: they are the initial ones again.
In other words, if the items
per_page are 6, and the total are 8, on page 2 I'll get 2 items, but instead of being items 7,8, they'll be 1,2.
Why? What's wrong?