My archive query contains a custom posts_per_page, order, orderby, post_type and paged (via wp-pageNavi).
array (
'order' => 'DESC',
'orderby' => 'title',
'paged' => 1,
'post_type' => Array (
'post',
'cust_article',
),
'posts_per_page' => 15,
);
My post_type contains 'post' and 'cust_article'.
I have 1 'post' and 65 'cust_article'.
posts_per_page is currently set to 5 in admin.
My problem is that the maximum amount of pages is limited by the amount of pages 'post' contains. Since I have only one 'post' the pages are limited to 1, even though I get all pages displayed (5 pages, posts_per_page set to 15), pages other than page 1 will return 404.
Creating a second 'post' and setting the posts_per_page to 1 allows access to the second page, following pages will also return 404.
I'm using the same query for my custom post_type archives, with a single post_type, adding a second to the query creates the same error.
I know that the paging is limited by the amount of posts and the set option posts_per_page. 5 ppp and 21 posts => maximum of 5 pages
By theory posts from 2 post_types should extend the post count. 5ppp and 21 posts + 12 posts => max 7 pages
pre_get_posts
instead.pre_get_posts
. Couldn't quite figure out how to use it with the sorting form I'm using (setting order, orderby in the session). I've ended up simply displaying all posts on this specific page, since there aren't many to display.