Title: riekus's Replies | WordPress.org

---

# riekus

  [  ](https://wordpress.org/support/users/riekus/)

 *   [Profile](https://wordpress.org/support/users/riekus/)
 *   [Topics Started](https://wordpress.org/support/users/riekus/topics/)
 *   [Replies Created](https://wordpress.org/support/users/riekus/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/riekus/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/riekus/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/riekus/engagements/)
 *   [Favorites](https://wordpress.org/support/users/riekus/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Plugin: Category Posts Widget] Category Posts Plugin ignoring ‘sticky’ posts](https://wordpress.org/support/topic/plugin-category-posts-widget-category-posts-plugin-ignoring-sticky-posts/)
 *  [riekus](https://wordpress.org/support/users/riekus/)
 * (@riekus)
 * [17 years, 7 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)