Just set post_type
to an array of types, and posts_per_page
to 1
and you’ll get the most recent post from those types.
$args = array(
'post_type' => array( 'type_1', 'type_2' ),
'posts_per_page' => 1
);
$latest = new WP_Query( $args );
Just set post_type
to an array of types, and posts_per_page
to 1
and you’ll get the most recent post from those types.
$args = array(
'post_type' => array( 'type_1', 'type_2' ),
'posts_per_page' => 1
);
$latest = new WP_Query( $args );