Excluding Sticky Posts from The Loop and from WP_Query() in WordPress?

The following snippet is from a sidebar widget that lists “recent posts”. Since its on the home page and I feature my lastest sticky post prominently on that page, I want to skip over the sticky in this loop. However, the post_not_in=sticky_posts has no effect. <?php $the_query = new WP_Query(“showposts=$number&offset=1&order=ASC&post_not_in=sticky_posts”); while ($the_query->have_posts()) : $the_query->the_post(); $do_not_duplicate … Read more

ignore_sticky_posts in WordPress 3.0.3?

I am using WP 3.0.3 and I would like to exclude sticky posts from my query: This doesn’t seem to work: <?php query_posts( ‘posts_per_page=9&cat=-1,-2&ignore_sticky_posts=1’ );?> To get JUST the sticky post I use the following: $sticky = get_option(‘sticky_posts’); $args = array( ‘posts_per_page’ => 1, ‘post__in’ => $sticky ); query_posts($args); 3 Answers 3 ignore_sticky_posts was introduced … Read more

Sticky Post default functionality with WP_Query is ignored when using AJAX

I am writing custom ajax pagination for a Blog archive page and I am running into an issue with sticky posts. The default functionality of sticky posts when using a WP_Query call is to sort all sticky posts at the top, unless explicitly stated otherwise. My AJAX is functioning correctly with no errors and displays … Read more

How to use custom fields to enable sticky posts on custom post types?

Background: The WordPress Answers site has two questions which ask about how to enable sticky posts on custom post types (see how to make custom posts sticky? and Enable sticky posts to custom post_type ). Both questions made mention of this trac ticket ( https://core.trac.wordpress.org/ticket/12702 ). The answers provided ( to those questions I mentioned … Read more

Adding Sticky functionality to Custom Post Type Archives

In WordPress, Custom Post Types do not have Sticky functionality as a core feature. It is possible, I’m sure, to create it in certain cases—and I’m working on a project that requires it for archive-{customposttype}.php templates. I have downloaded and installed a plugin, called Sticky Custom Post Types, which I read in this article could … Read more