I’ve gone through the Codex and Google trying to make this query work, but it doesn’t want to budge no matter how many examples I follow.
I’m trying to do a query on a custom field that allows me to select all data with post_type of “homes” that has a “square_footage” >= [number] AND <= [number]
Here is what my current query looks like
$args = array( 'post_type' => "homes", 'post_status' => 'publish', 'posts_per_page' => -1, 'meta_query' => array( 'key' => 'square_feet', 'value' => array( $nums, $nums ), 'compare' => 'BETWEEN' ); );
When I do a print_r on the $args varialbe, I get the following:
Array ( [post_type] => homes [post_status] => publish [posts_per_page] => -1 [meta_query] => Array ( [relation] => AND  => Array ( [key] => square_feet [value] => Array (  => 1000  => 1250 ) [compare] => BETWEEN ) ) )
I would greatly appreciate any help 🙂 Thanks!
- The topic ‘Advanced WP_Query’ is closed to new replies.