Quering array of post types & pagination
-
Hello,
I am doing some page with filters and spotted interesting bug (is it a bug??) related to quering articles (posts).In my case I want to output default “post” articles and my custom post type “blog”.
In test environment I have 100+ post articles and 8 blog articles.
I tried query_posts() and pagination gets messed up.
Also pagination gets messed up with wp_query.Well, maybe I am doing something wrong.
If I output only single post type, all works fine.
My args look like this:
'post_type' => array('post', 'blog'), 'post_status' => 'publish', 'posts_per_page' => 6,
I am doing it with AJAX, so my query is in functions.php.
I copied results to gsheets and marked titles which were repeating. I can tell that this is not related to offset. This is related to merged post types. So if I have 2 blog articles only, two “posts” articles are repeated.
If I have 8 blog articles, table looks a little horrible ??What am I doing wrong?
If there any hack for multi post type?
I have the most recent wordpress version.
Regards
- The topic ‘Quering array of post types & pagination’ is closed to new replies.