Title: query_posts Category not working
Last modified: August 22, 2016

---

# query_posts Category not working

 *  [patrickquirke](https://wordpress.org/support/users/patrickquirke/)
 * (@patrickquirke)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/query_posts-category-not-working/)
 * I am wanting to have this sidebar widget just show a certain category. I have
   tried adding `'category_name' => 'my-category-slug',` but no luck just doesn’t
   display the widget at all
 *     ```
       <?php wp_reset_query(); query_posts(
                           array(
                               'post_type' => 'news',
                               'post__not_in' => get_option('sticky_posts'),
                               'orderby' => 'date',
                               'order' => 'DESC',
                               'posts_per_page' => '3'
                           )
                       );
       ```
   
 * [http://quptheweb.com/vop/pediatrics/](http://quptheweb.com/vop/pediatrics/)

The topic ‘query_posts Category not working’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [patrickquirke](https://wordpress.org/support/users/patrickquirke/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/query_posts-category-not-working/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
