Title: Please help
Last modified: August 19, 2016

---

# Please help

 *  [michalien](https://wordpress.org/support/users/michalien/)
 * (@michalien)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/please-help-90/)
 * Can anyone please help with this topic:
 * [http://wordpress.org/support/topic/427146?replies=3](http://wordpress.org/support/topic/427146?replies=3)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/please-help-90/#post-1599249)
 * From what I can tell, the answer is to use multiple loops. Although I haven’t
   been able to spot it in the code in query.php, it seems that when you ask for
   specific categories, the stickies are ignored.
 *  Thread Starter [michalien](https://wordpress.org/support/users/michalien/)
 * (@michalien)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/please-help-90/#post-1599286)
 * I’m using a custom loop with get_posts(). Stripping out the category parameter
   and using a bare get_posts() call still doesn’t put the sticky post at the top.
 * This original topic thread was for a custom loop using query_posts() – according
   to the Codex both are supposed to work with the same parameters for WP2.6+
 * [get_posts parameters](http://codex.wordpress.org/Template_Tags/get_posts#Parameters:_WordPress_2.6.2B)
 * [query_posts parameters](http://codex.wordpress.org/Function_Reference/query_posts#Sticky_Post_Parameters)
 *  [Chinmoy](https://wordpress.org/support/users/chinmoy/)
 * (@chinmoy)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/please-help-90/#post-1599289)
 * ** Sticky Post Parameters**
 * Sticky posts first became available with WordPress Version 2.7. Posts that are
   set as Sticky will be displayed before other posts in a query, unless excluded
   with the caller_get_posts=1 parameter.
 *  * array(‘post__in’=>get_option(‘sticky_posts’)) – returns array of all sticky
   posts
    * caller_get_posts=1 – To exclude sticky posts being included at the beginning
   of posts returned, but the sticky post will still be returned in the natural 
   order of that list of posts returned.
 * To return just the first sticky post:
 *     ```
       $sticky=get_option('sticky_posts') ;
       query_posts('p=' . $sticky[0]);
       ```
   
 * or
 *     ```
       $args = array(
       	'posts_per_page' => 1,
       	'post__in'  => get_option('sticky_posts'),
       	'caller_get_posts' => 1
       );
       query_posts($args);
       ```
   
 * Note: the second method returns only the more recent sticky post; if there are
   not sticky posts, it returns the last post published.
 * To return just the first sticky post or nothing:
 *     ```
       $sticky = get_option('sticky_posts');
       $args = array(
       	'posts_per_page' => 1,
       	'post__in'  => $sticky,
       	'caller_get_posts' => 1
       );
       query_posts($args);
       if($sticky[0]) {
          // insert here your stuff...
       }
       ```
   
 *  [Samuel B](https://wordpress.org/support/users/samboll/)
 * (@samboll)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/please-help-90/#post-1599299)
 * dupe
    [http://wordpress.org/support/topic/427146?replies=3](http://wordpress.org/support/topic/427146?replies=3)

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Please help’ is closed to new replies.

## Tags

 * [get_posts](https://wordpress.org/support/topic-tag/get_posts/)
 * [query_posts](https://wordpress.org/support/topic-tag/query_posts/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 4 participants
 * Last reply from: [Samuel B](https://wordpress.org/support/users/samboll/)
 * Last activity: [15 years, 10 months ago](https://wordpress.org/support/topic/please-help-90/#post-1599299)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
