Merge 2 post types from different categories
-
Hello,
I have 2 post types, “news” and the regular “post”. I want to merge these 2, so I build a WP_Query:
$news = new WP_Query(array("post_type" => array("news", "post"), "showposts" => 2));
That works very well. But; from “post” I want only items places in categorie 10, so I tried this:
$news = new WP_Query(array( "post_type" => array("news", "post"), "showposts" => 2, "category__in" => array(10) ));
Results: nothing for “news” gets displayed because none of those messages apply the the “category__in” selection. How do I get category__in to apply only to posts?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Merge 2 post types from different categories’ is closed to new replies.