Posts Per Page -> Per Post Type
-
Hi all,
Sorry if this has been covered, been googling for a while.
I have a query that contains 3 custom post types (‘news’, ‘exhibitors’, ‘speakers’).
I would like to display a total of 6 posts per page and 2 custom post types each, so two news, two exhibitors and two speakers.
Currently if I specify ‘posts_per_page’ => 6′ and there is only 1 news article, 1, exhibitor there will be 4 speakers shown.
I almost need a ‘posts_per_post_type’ if that makes sense.
Query below, many thanks in advance.$args = array( 'post_type' => array('news', 'exhibitors', 'speakers'), 'posts_per_page' => 6, 'order' => 'DESC', 'orderby' => 'type', 'paged' => $paged, 'tax_query' => array( array( 'taxonomy' => 'foebar', 'field' => 'slug', 'terms' => array( $post_slug ) ) ));
- The topic ‘Posts Per Page -> Per Post Type’ is closed to new replies.