This question already has an answer here:
- How to fix pagination for custom loops? 2 answers
I'm having an issue getting my custom taxonomy page to paginate correctly. I looked through other examples posted on this forum, but I could not get my second page to not return a 404 error page. Here are my details
- Custom Tax: Study_Tags
- Example Terms: Community, Economy, Crime...
- Custom Taxonomy Page: taxonomy-study_tags.php
- Posts Per Page: 5 (set in Reading Settings, global for all pages/posts on site)
I am using a Custom Post Type "Study" with the custom taxonomy "Study Tags", which is why i feel I need to use the "query_posts()" function.
I only want to show parent pages in the results, as each "Study" CPT can have children page with study details, presentations... etc.
My information to setup the query
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array_merge( $wp_query->query_vars, array( 'post_type'=> 'study', 'post_parent' => '0', 'paged' => $paged, 'order' => 'ASC', )); query_posts($args); ?>
$wp_query->query_vars passes for example "[study_tags] => community" when var_dump() is used, so I know it is transmitting the correct term to the custom tax page.
Any ideas how to get a second page of results?