Excluding sticky posts using query_posts()
-
I had posted this on another thread but it’s now been marked resolved without an answer to my query…
I want to exclude the sticky posts from the loop and the previous thread had this solution;
query_posts(array( "post__not_in" => get_option("sticky_posts") ));
I’ve used this solution but it’s not working for me. I’m using it in the second loop in my home.php file, which is preceded by wp_reset_query().
The first loop uses this wp_query:
query_posts(array(‘post__in’=>get_option(‘sticky_posts’)));The second uses:
query_posts(array(“post__not_in”=>get_option(“sticky_posts”)));But I see the same (sticky) post as the first post produced by both loops. In date order it would be the third post.
Any idea why this wouldn’t work?
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Excluding sticky posts using query_posts()’ is closed to new replies.