I have post type: All items, i need in this All items display posts from post type: Archive and Recent, how i can in post type All items - get posts form 2 post types
1 Answer
You will need to setup a new query to get posts from another post_type. The post_type parameter will accept an array, so you can just do:
$other_posts = new WP_Query([
'post_type' => [ 'archive', 'recent' ], // or what ever your post_types are.
]);
// Then do your loop...
Check this documentation for more information. https://developer.wordpress.org/reference/classes/wp_query/#post-type-parameters
-
i need just output in one post type all posts with another post types– user89886Apr 20, 2018 at 21:51