Pagination Redirect Issue in author.php Using Custom Post Types
-
In author.php I’m trying to paginate results limited to three specific custom post types using the wp-pagenavi plugin.
Hovering over the links in the pagination list shows the correct url structure for the pagination but when clicked redirects to /page/0/ instead of /page/2/ or /page/3/ etc. Have tried changing permalink structure, saving the permalink settings, changing to default, resetting the postdata, merging the queries, on and on, etc… Still getting a /page/0/ redirect with pretty permalinks and a 404 with default structure. Anyway, allons-y:
<?php $paged = (get_query_var('page')) ? get_query_var('page') : 1; query_posts( array( 'post_type' => array( 'sale', 'vacation', 'lease', ), 'tax_query' => array( array( 'taxonomy' => 'author', 'field' => 'slug', 'terms' => $curauth->user_login ) ), 'paged' => $paged, 'tag__not_in'=>array('34'), 'orderby' => 'meta_value_num', 'meta_key' => 'price', 'order' => 'DESC', 'posts_per_page' => '9' ) // for paging links to work ); ?> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> //code, hooks, etc… <?php endwhile; ?> <?php wp_pagenavi(); ?> <?php else : ?> // some other stuff <?php endif; wp_reset_query(); ?>
So, when the numbers within the wp_pagenavi() hook are clicked, I get the redirect to /page/0/. No idea what’s happening, but there seems to be issues with CPT pagination. Some of the issues have been resolved but I can’t find a solution that applys to the author pages and this specific redirect issue.
Other notes: I am using w3 total cache, so my .htaccess has all of those rules along with the basic wordpress stuff.
- The topic ‘Pagination Redirect Issue in author.php Using Custom Post Types’ is closed to new replies.