Unexpected meta_query results
-
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.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Unexpected meta_query results’ is closed to new replies.