Reputation: 5
As the title says. Is there any way to get the latest posts from multiple post types in one single loop? Without using wpdb if at all possible?
Upvotes: 0
Views: 168
Reputation: 11
I believe using WP_Query()
, you can choose an array of post types. Here is an (untested) example:
<?php
$query = new WP_Query($args);
$args = array(
'post_type' => array('post', 'custom-post-type'),
'posts_per_page => 3
);
?>
Upvotes: 1