0
$recent_posts = new WP_Query(
   array('posts_per_page'       => $blog_num_posts,
         'paged'                => $paged,
         'post_type'            => 'post',
         'post_status'          => 'publish',
         'cat'                  => $categories,
         'category__not_in'     => $categories_exclude,
         'ignore_sticky_posts'  => 0
    ));

This should load all recent_posts including the sticky posts - now I want to order them according to the "stickyness" but i can't figure out how..

WP Version (Version 4.0)

  • 2
    Does it not happen? Where does sticky posts end up in order? – Rarst Oct 13 '14 at 18:44
  • Just one question, why are you using cat and category__not_in together. If you use the cat parameter, all other categories not explicitly added to the cat parameter will be excluded by default – Pieter Goosen Oct 13 '14 at 18:50
  • It's a snap out of the template i used for this. the porblem is that the sticky posts will show up but not ordered as the first once. – DominikAngerer Oct 13 '14 at 18:55
  • 1
    Do you want the sticky posts in the beginning of the result set? – Cyclonecode Oct 13 '14 at 18:55
  • They end up ordered by date like the other posts.. – DominikAngerer Oct 13 '14 at 18:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.