I´ve read almost this articles but unfortunately my query is no working, I think i´m very close but could be so far away.
I´m trying to get metadata using a custom form with method get,
$rob = $_GET['rob'];
$bedrooms = $_GET['beds'];
$bathrooms = $_GET['baths'];
the array is:
$args = array(
'meta_query' => array(
array(
'key' => 'beds_value',
'value' => '$bedrooms',
'compare' => 'LIKE'
),
array(
'key' => 'baths_value',
'value' => '$bathrooms',
'compare' => 'LIKE'
),
array(
'key' => 'rob_value',
'value' => '$rob',
'compare' => 'LIKE'
),
),
);
$args = array_merge( $args , $wp_query->query );
query_posts( $args );
depending on final query the results are diferent
this display none, seems to be this clean the query
$args = array_merge( $args , $wp_query->query );
query_posts( $args );
but if is used $query = new WP_Query( $args );
I get all results without any filter.
but I can see the query data Ex 2 beds, 2 baths
Do I need to write something more?