Articles of sticky post

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 […]

Sticky Posts Not Sticking to Top of Category Archive

I’m using my index.php to display post archive pages rather than a specific archive.php file. This works fine, however sticky posts do not stick to the top of it. They do however, stick to the top of the posts page. Are sticky posts not supposed to stick to the top of archive pages? Here is […]

wp_query for the first sticky, then display the rest of the posts excluding the first sticky

I’ve been reading this by @nacin and getting to grips with wp_query over query_posts that I used to use. What I want is: to put this in a template file to query all posts of this category, in this case ‘3’ to display, if available, the first result on the page the latest sticky post […]

WP_Query doesn't get sticky post at the top, when used in a page template

I’m creating a theme in which I’ve created a page template called page_default-blog.php to be used for creating a blog page. In this file I have the following code: $paged = (get_query_var(‘page’)) ? get_query_var(‘page’) : 1; $args = array( ‘paged’ => $paged, ); $custom_query = new WP_Query($args); if ($custom_query->have_posts()) : while($custom_query->have_posts()) : $custom_query->the_post(); ?> the_title(); […]

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);

How to make post sticky in the admin page?

i work with restaurant plugin that use custom post type. the question is, if it possible to select some post and make him sticky (always be in the top) in the admin? i need this because when you add many items to the restaurant menu, it becomes hard to find the items(posts). so i just […]

Display all custom post type posts and order them by an optional meta_key

I have a custom post type (CPT) called property. I have registered a featured property metaboxfor it as explained in this question “How do I create a featured post within a custom post type?”. So a featured property has got meta_key=’property_featured’ and meta_value=on. What I would like to do is to display all property posts, […]

Schedule Sticky Posts

I’d like to display the most two recent published sticky posts by modifying the primary loop. A simple affair with the following loop. However, if I schedule a sticky post to be published in the future, the loop fails – only displaying one sticky post. It’s like it can see that there is a new […]

Display only the most recent sticky post, display other posts in chronological order

I want to display only the most recent sticky post at the top of the TwentyEleven page, and display the rest of the posts in chronological order, no matter whether they are sticky or not. I tried to find. solution here: But it doesn’t seem to have what I need. Could someone please help […]

Exclude Sticky posts from Main Query break Pagination

I have a small problem with this function ! I would like to exclude all sticky post from my query but when I do it, it breaks my pagination. In the following code, when I remove the “‘post__not_in’ => $sticky” my pagination works like a charm… Any advice would be much appreciated ! Cheers. /* […]