I am sorting post and displaying a single category with this code.
global $post;
$args = array(
'category_name'=>'oranges',
'numberposts' => -1,
);
I would like to display all post that are in both "oranges" and "apple" categories so I have modified the code I am using to display a single category to this:
global $post;
$args = array(
'category_name'=>'oranges',
'category_name'=>'apples',
'numberposts' => -1,
);
This displays only the post in the apples category.
Thanks
'category_name'=>'oranges,apples'
or'category_name'=>'oranges+apples'
– Arsalan Mithani