Title: [Plugin: Category Posts Widget] Category Posts Plugin ignoring &#8216;sticky&#8217; posts
Last modified: August 19, 2016

---

# [Plugin: Category Posts Widget] Category Posts Plugin ignoring ‘sticky’ posts

 *  [Katherine White](https://wordpress.org/support/users/katwhite/)
 * (@katwhite)
 * [18 years ago](https://wordpress.org/support/topic/plugin-category-posts-widget-category-posts-plugin-ignoring-sticky-posts/)
 * Hi there,
 * For some reason, the [Category Posts Widget](http://wordpress.org/extend/plugins/category-posts/)
   plugin is ignoring ‘sticky’ and ‘announcement’ posts as implemented in [WP-Sticky](http://wordpress.org/extend/plugins/wp-sticky/).
   See [http://preview.austinrwa.org/](http://preview.austinrwa.org/) for an example.
   In the sidebar, the top “Next Meeting’ area is populated using Category Posts;
   the bottom “Next Meeting?” area is a test case populated using the built-in WordPress
   Recent Posts widget. I’ve set the May 2008 meeting post to be an ‘announcement’.
   Recent Posts sees the sticky status fine, but Category Posts isn’t registering
   it.
 * Any ideas on how to fix? I tried porting the query code over from Recent Posts
   and mucking with it, but only succeeded in blowing things up. Thanks for any 
   help you can lend me!

Viewing 1 replies (of 1 total)

 *  [riekus](https://wordpress.org/support/users/riekus/)
 * (@riekus)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/plugin-category-posts-widget-category-posts-plugin-ignoring-sticky-posts/#post-771753)
 * wordpress 2.7 by default has the ‘sticky’ option, but it is still ignored by 
   the category posts plugin. I have modified the plugin to support stickies:
 * replace cat-posts.php, line 40 with this:
 *     ```
       $cat_sticky = get_posts(array('post__in'=>get_option('sticky_posts'),'category'=>$cat_id));
       if($cat_sticky[0]){
       	$num -= count($cat_sticky);
       }
       $cat_nonSticky = get_posts(array('post__not_in'=>get_option('sticky_posts'),'category'=>$cat_id,'numberposts'=>$num));
       $cat_posts = array_merge($cat_sticky,$cat_nonSticky);
       ```
   
 * This way, all the stickies from the category will be read first, then all the‘
   non-stickies’
 * Hope it works for you

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: Category Posts Widget] Category Posts Plugin ignoring ‘sticky’
posts’ is closed to new replies.

 * 1 reply
 * 2 participants
 * Last reply from: [riekus](https://wordpress.org/support/users/riekus/)
 * Last activity: [17 years, 2 months ago](https://wordpress.org/support/topic/plugin-category-posts-widget-category-posts-plugin-ignoring-sticky-posts/#post-771753)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
