• $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)
Viewing 1 replies (of 1 total)
  • The topic ‘'category__in' problems’ is closed to new replies.