The meta_query argument takes an array of arrays.
'meta_query' => array(
array(
'key' => 'city',
'value' => 'true',
'compare' => 'NOT LIKE',
)
)
Related Posts:
- Can wp_query return posts meta in a single request?
- Getting attachments by meta value
- meta_query where value is equal to given value
- WordPress altering my custom query, How to fix it?
- Group WP_Query by meta_key date
- How to make Meta Query case sensitive?
- Display custom field meta outside loop, site wide
- Fetch Record based on meta key dates
- how to make members list directory through wordpress post custom meta key.
- Large AND OR query timing out
- Order WP_Query results by meta key value in custom query
- Display post meta conditionally based on it’s value
- How do i create a custom post query when the meta value is an array?
- Trouble with serialized metadata
- Query against multiple locations within single custom post type post
- Meta key in wp_query bug?
- Sorting Posts with meta value not working
- Custom Search Query – include only custom fields and title
- Extend search query to search meta keys values based on search string
- How to only display posts whose meta_value field is not empty?
- order by numeric value for meta value
- How do I query for posts by partial meta key?
- Use REGEXP in WP_Query meta_query key
- Meta query with string starting like pattern
- compare meta_query in get_posts arguments
- WordPress retrieving meta data for all custom post types in list view
- Order by optional meta key?
- How can I use order_by to order by two meta_keys without excluding posts that don’t have those keys initialized?
- meta_query: using BETWEEN with floats and/or casting to DECIMAL
- Reduce or prevent calling of update_meta_cache
- Function in array as arguments for WP_Query
- Is there a way to extend WP_query so Custom Post Types can have properties?
- WP_Query to show post from a category OR custom field
- What is the most efficient way of querying posts based on visits and date for current day?
- Sorting posts by custom date fields (non standard date format)
- WP_Query displaying ALL posts
- Query Custom Meta Value with Increment
- WP-CLI How to generate a list of posts with corresponding meta values
- Get_post() with meta_key when compare is a date
- querying with custom meta field with meta_query
- Group posts by custom field
- Order by meta_value_num DESC and meta_value ASC on WP 4.0
- What is an efficient way to query based on post_meta?
- Custom query with category exclusion and post-meta “whitelist”
- WP_Query not working as expected for attachments and custom meta_query
- getting posts and number by specific meta value in multiple meta
- How to count post meta key values for all posts in database
- How to query using a combination of custom_field values?
- Sorting Posts by custom field
- Order posts by date and then by custom field
- Group posts by meta_key
- How should I use posts_where to change meta_value from a string to integer?
- Revolution Slider Orderby Two Custom Fields
- Query two post types and order by two different date fields
- How can I create a WP_Query that returns posts where one meta_value
- WP Meta Query for some meta (array) values
- Querying by taxonomy vs Querying by Custom fields Speed Comparison
- WP Query post meta value
- Would this post meta be better added to the post table rather than post_meta table
- Custom URl parameter
- query posts in functions.php and update a field
- Compile meta values from custom loop into array and then calculate sum total
- How to get sum of meta_values of a meta_key in wp_query according to conditions
- how to fire join query with post_meta
- Order by meta_key in custom post type doesn’t affect the query
- Best approach to create Hot and Trending sections
- WP_Query, custom sort and custom filter
- How to show only one post for each categories of taxonomy of custom post that contains a specific custom field
- meta_key and meta_value not working together
- How can i make WP_Query return post image and categories?
- Custom Field sort not working (WP 3.8.1)
- Order posts by meta value and Date
- wp_query with multiple custom fields
- Efficient way to update multiple post meta
- How add a custom posttype name using ACF field to a query post array
- Filtering posts by custom field value not working
- How to make orderby ‘meta_value_num’ OPTIONAL?
- Display link to taxonomy archive only if it has posts with certain custom field values
- getting posts and number by specific meta value in multiple meta
- Ordering Posts Type A by Custom Fields of related Post Type B
- Query Posts depends on custom field inside repeater field using acf
- Author Page Custom Query WHERE author OR [post meta value] OR [post meta value]
- Order Posts by meta value AND published date
- Query post with meta_query where date is not in future
- Minimising Database Queries when using Advanced Custom Fields
- Get meta info related to current post
- Select from wp_post and multiple meta_value from wp_postmeta
- Pull post meta with post_query?
- Search Posts with Custom Fields as query
- wp_query add arguments using array_push if variable met
- WP_query posts closest to todays date
- How do I use wp_query for WordPress search?
- How To Fix WP Query Returns Results But Shouldn’t?
- Get posts for which a custom field is not present, with get_posts
- Output an array of terms for a ‘tax_query’ => array()
- Inserting serialized value into wp_postmeta using update_post_meta
- Add quicklink to in the Admin posts page where I can query by a meta_key
- Performance when getting post meta for post retrieved by meta value
- How to Filter Posts by Custom Fields?
- Get attachment by meta_key value