Many people report problems with pagination of custom queries or custom post type archives: url/page/2 produces a 404 even though all the setup is correct.
Many end up figuring out that this is occurring because the posts_per_page of their custom loop is less than the maximum posts per page setting in the admin, which they fix by changing
Settings » Reading » "Blog pages show at most: ____ posts"
This works in my situation, but I would much prefer to change this only for this specific custom query, rather than the whole site. Is this possible?
The relevant WP_Query is this:
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $wp_query = new WP_Query( array( 'post_type' => 'publication', 'posts_per_page' => 5, 'paged'=>$paged));