I'm trying to create a search results listing for a custom post type and the problem I'm running in to is with the way the 'meta_query' parameter is stringing the passed values together. It appears to be treating each 'meta_query' value as an 'AND' rather than 'OR'. Here is the code I'm using:
$strsearch = 'lorem'; $args = array( 'post_type' => 'products', 'meta_query' => array( array('key' => '_product_make','compare' => 'LIKE','value' => $strsearch), array('key' => '_product_model','compare' => 'LIKE','value' => $strsearch) ) ,'s' => $strsearch); $resource_query = new WP_Query($args);
When I search anyone of the fields individually I get the desired results. When I use them together it comes up as not found since the string I'm searching for may only occur in one of the three fields listed below. Is there any way to have 'meta_query' treat each of the passed field comparisons as 'OR'?