Show only sticky posts ignores posts_per_page
-
Hi dear,
I have a problem with the plugin when I want to show only sticky posts, with a fixed limit number, in the widget.From ultimate-posts-widget.php i’ve added print array on line 204:
$args = apply_filters('upw_wp_query_args', $args, $instance, $this->id_base); print_r($args); $upw_query = new WP_Query($args);
And here is the return variable:
Array ( [posts_per_page] => 6 [order] => DESC [orderby] => date [category__in] => [tag__in] => [post_type] => any [post_status] => Array ( [0] => publish [1] => inherit ) [post__in] => Array ( [0] => 8586 [1] => 8634 [2] => 8643 [3] => 8649 [4] => 8787 [5] => 8821 [6] => 8896 [7] => 9041 [8] => 9066 [9] => 9082 [10] => 9175 ) )
As you can see, posts_per_page is set to 6 but there are more sticky posts. In this case WP ignores the posts_per_page because it includes sticky posts twice.
Adding
'ignore_sticky_posts' = 1
should fix the problem.Kind regards and keep up the good work!
Marco Milesi
- The topic ‘Show only sticky posts ignores posts_per_page’ is closed to new replies.