How to combine two or more WP_Query?
Hope this code may work for you. $query1 = new WP_Query( array( ‘post_type’ => ‘product’, ‘s’ => $searchStr )); $query2 = new WP_Query( array( ‘post_type’ => ‘product’, ‘meta_query’ => array( array( ‘key’ => ‘my_meta_key’, ‘value’ => $searchStr, ‘compare’ => ‘LIKE’ ) ) )); $result = new WP_Query(); $result->posts = array_unique( array_merge( $query1->posts, $query2->posts ), SORT_REGULAR … Read more