Pagination for Custom Taxonomy Page

This question already has an answer here:

  • How to fix pagination for custom loops?

    4 answers

Solutions Collecting From Web of "Pagination for Custom Taxonomy Page"

First of all: never use query_posts: when you need to change the main query, is a lot better use the pre_get_posts hook: your site users will thank you, once performance will increase.

If the custom taxonomy study_tags is used only for study CPT the only reason to change default query is to set post parent to 0.


function set_study_parent( $query ) {
  if ( ! is_admin() && is_main_query() && is_tax('study_tags') ) {
    $query->set( 'post_parent', 0 );

Then in your taxonomy-study_tags.php template, you can just use the loop. Pagination will work without doing anything else.