Title: &#039;category__in&#039; problems
Last modified: August 20, 2016

---

# 'category__in' problems

 *  [rubbed](https://wordpress.org/support/users/rubbed/)
 * (@rubbed)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/category_in-problems/)
 *     ```
       $args = array(
               'category__in' => 13,22,23,30,45, //An array of category IDs to be included.
               'post__not_in' => array($post->ID), //An array of post IDs to be excluded from the results.
               'orderby'=> 'rand', //Lists Related posts Randomly. *** MODIFY IF YOU LIKE ***
               'showposts' => 10, //*** MODIFY TO WHAT YOU LIKE.***  Number of related posts to show.
               //'caller_get_posts' => 1 //*** USE THIS IF YOU ARE RUNNING WordPress Version < 3.1 ***
               'ignore_sticky_posts' => 1 //*** USE THIS for WordPress Version >= 3.1 ***
           );
       ```
   
 * I have this code but the category_in does not work, it only displays ID 13.
 * What is the correct way to get it to display all 5 categories? I tried putting
   the digits in brackets but my site got an error.

Viewing 1 replies (of 1 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/category_in-problems/#post-2652036)
 * `'category__in' => array(13,22,23,30,45), //An array of category IDs`

Viewing 1 replies (of 1 total)

The topic ‘'category__in' problems’ is closed to new replies.

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 2 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/alchymyth/)
 * Last activity: [14 years, 2 months ago](https://wordpress.org/support/topic/category_in-problems/#post-2652036)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
