How to get all user posts from two post types in wp_query

Ye. It is possible with single query. WordPress is allowed to fetch posts from different post type. For example, consider the default post types “post” and “page” To fetch user posts from “post” and “page”, we can use the following query. $wp_query = new WP_Query(array( ‘author’ => $user_id, ‘post_type’ => array(‘post’, ‘page’), ‘posts_per_page’ => -1 … Read more