0

I have some custom post types. I want to loop through three of them and only show two posts per each post type!

The following code works, it gets the posts I want, however if there are 4 posts in 'humour' and 2+ in 'crime', the query never gets to 'romance' posts

$args = array( 'post_type' => array('humour', 'crime', 'romance'), 'showposts' => 6);
$query = new WP_Query( $args );

I did think about creating three different new queries (using WP_Query), but I have a feeling that would be an overkill! Is there another way to do this?

4

1 回答 1

1

尝试这个

"numberposts" => 2,

于 2013-11-06T15:55:12.177 回答