0

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 1

0

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

1
  • i need just output in one post type all posts with another post types
    – user89886
    Apr 20, 2018 at 21:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.