WP_Query posts_per_page ignored

I struggle already for a few hours with the posts_per_page ignored in my WP_Query :

[query] => Array
(
    [post_type] => Array
        (
        )

    [posts_per_page] => 4
    [meta_key] => _touchsize_likes
    [orderby] => meta_value_num
    [order] => DESC
)

The result has found_posts = 18 and 12 posts in the posts array.

Even if the only parameter set is posts_per_page, the results are wrong.

Checked the query_vars['post_type'], the value is 4. Tried with suppress_filters => true, still no effect.

Any idea ?

1 Answer
1

It were the sticky posts who ignored my posts_per_page. After setting 'ignore_sticky_posts' => true the result was correct !

Leave a Comment