Title: get_posts conflict
Last modified: August 20, 2016

---

# get_posts conflict

 *  [saramac](https://wordpress.org/support/users/saramac/)
 * (@saramac)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/get_posts-conflict/)
 * In my sidebar, I’m trying to feed in posts from two different categories. The
   first one is fine, but the second is duplicate of the first. I’ve scoured the
   Codex and I can’t find a solution. I’m sure it must be something easy that I’m
   missing out on. If someone could point me in the right direction, I’d be extremely
   thankful.
 * _
    [[code moderated – please use the pastebin](http://codex.wordpress.org/Forum_Welcome#Posting_Code)]
 * A secondary issue is that, for the second feed (Upcoming Events) I want to display
   content from 4 different categories.

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

 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/get_posts-conflict/#post-2528907)
 * I think the parameters to your second get_posts() need to be changed from this:
 *     ```
       get_posts('numberposts=2category=3,4,5,6');
       ```
   
 * to this:
 *     ```
       get_posts('numberposts=2&cat=3,4,5,6');
       ```
   
 * See the Codex article on [Category Parameters](http://codex.wordpress.org/Class_Reference/WP_Query#Category_Parameters).
 *  Thread Starter [saramac](https://wordpress.org/support/users/saramac/)
 * (@saramac)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/get_posts-conflict/#post-2529023)
 * Thanks vtxyzzy. Here’s what I ended up with that worked. Maybe it will help someone
   else. There was a problem with using get_posts in the side bar for some reason.
   query_posts ended up working out.
 * _[**code moderated **for the second time – please use the [pastebin ](http://pastebin.com/)–
   read [http://codex.wordpress.org/Forum\_Welcome#Posting\_Code](http://codex.wordpress.org/Forum_Welcome#Posting_Code)]_

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

The topic ‘get_posts conflict’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [saramac](https://wordpress.org/support/users/saramac/)
 * Last activity: [14 years, 4 months ago](https://wordpress.org/support/topic/get_posts-conflict/#post-2529023)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
