Query post with meta
// WP_Query arguments $args = array( 'post_type' => array( 'locations' ), 'meta_query' => array( 'relation' => 'AND', array( 'key' => 'wpcasama_max_price', 'value' => '$price', 'compare' => '<=', 'type' => 'NUMERIC', ), array( 'key' => 'wpcasama_min_price', 'value' => '$price', 'compare' => '>=', 'type' => 'NUMERIC', ), ), ); // The Query $query = new WP_Query( $args );