I'm using the value of a form post var in this meta_query but the result page is returning every post in the category, seemingly ignoring the key/value:
$args = array(
'category_name' => 'dealers',
'meta_query' => array(
array(
'key' => 'state',
'value' => '"' . $locationData . '"'
)
),
'orderby' => 'title',
'order' => 'ASC',
'posts_per_page' => '-1'
);
$the_query = new WP_Query( $args );
//Show posts
if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
blah blah etc.
Also, it's ignoring the -1 for posts_per_page (which should attempt display all matching posts).
Have I made a glaring error or is there an issue with this syntax?
Thanks.