pagination fails on /page/3/ and above
-
This page: https://amagents.staging.libertyconcepts.com/our-stories/ uses a query that displays 15 custom posts to desktop devices, 6 posts to tablets, and 3 posts to phones. The pagination cannot find /page/3/ and greater (returns a 404). There are currently 18 posts, so for now this error can only be seen on handhelds; but in my local environment, if I set the numposts to a number that always requires more than 2 pages, it breaks on desktop as well.
The post number is set through a var like this (using mobble plugin to make additional device-sniffing available):
$numposts = 0; if(!is_handheld()) { $numposts = 15; } elseif(is_handheld() && !is_tablet()) { $numposts = 3; } else { $numposts = 6; } $story_query = new WP_Query( array ( 'order' => 'ASC', 'orderby' => 'title', 'paged' => $paged, 'post_type' => 'cwa_stories', 'post_status' => 'publish', 'posts_per_page' => $numposts, ) ); if ($story_query->have_posts()) : $c = 0; $post = $posts[0]; while ( $story_query->have_posts() ) : $c++; $story_query->the_post();
and pagenavi is called with this:
wp_pagenavi(array('query'=>$story_query));
Any ideas?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘pagination fails on /page/3/ and above’ is closed to new replies.