Normally you would just specify a meta_value, e.g.:
$args = array(
'post_type' => 'business',
'meta_query' => array(
array(
'key' => 'specials',
'value' => 'these are not the specials you are looking for - Obi Wan Kenobi'
)
)
);
However because your post meta is actually a data structure, a serialised PHP array/object, that’s not possible.
You can read more here:
http://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters
Related Posts:
- Meta Query with AND & OR?
- How do I search an array stored in a custom-field using WP_Query?
- Trying to perform complex custom field query with order by set to field value
- Compare meta_query decimals not working right
- Using OR in WP_Query negates the “NOT EXISTS” compare
- How can I combine meta_query queries?
- Difference between ‘LIKE’ and ‘IN’ in meta queries
- WP_Query display next custom post from today’s date
- WP Query Returning All Posts
- Meta query with timestamp using WP_query
- Meta Query And/Or
- Query post by date (stored custom field meta as yyyymmdd) and differentiate across 12 months
- change order of images attached to post
- How can I modify my meta_query to work with prices that are stored in the database that contain dollar signs and commas?
- Trouble with serialized metadata
- WP_Query – Order results by meta value
- Query to sort a list by meta key first (if it exists), and show remaining posts without meta key ordered by title
- Meta query with string starting like pattern
- compare meta_query in get_posts arguments
- Add custom fields to search
- SELECT max(meta_value) FROM wp_postmeta WHERE meta_key=’price’… stops working when value is over 999
- Getting attachments by meta value
- WP doesn’t show Array Custom Fields?
- How to query serialized array by comparing greater than (>=)?
- querying with custom meta field with meta_query
- Order by meta_value_num DESC and meta_value ASC on WP 4.0
- How to get a meta value from all post
- WordPress altering my custom query, How to fix it?
- Ordering posts by anniversary using only day and month
- Comparing timestamps in meta query doesn’t work
- Display two post types ordered by two custom fields
- use get_posts to get custom field data, but in one array
- Order by meta_key in custom post type doesn’t affect the query
- How can I query on the year part of a complete date in a custom field?
- WP_query : meta_key with custom rule for specific value
- meta_value_num sort glitch
- Order by value in serialized custom field
- Author Page Custom Query WHERE author OR [post meta value] OR [post meta value]
- Order Posts by meta value AND published date
- Sorting posts by custom fields in meta_query
- meta_query for a string inside a meta field containing a comma-separated list
- Order by custom field value not working for acf date field
- Upcoming Event: How do I sort database by custom date field, but ignore past dates?
- How do I use wp_query for WordPress search?
- Passing Custom Field Data as Array to be Saved (Resulting Custom Field Array is inconsistent)
- Conditional custom field query
- Order query by meta_value with multiple custom fields
- Two near-identical custom field types – one works, the other doesn’t . What can cause this?
- wp_query check if integer exists in custom field’s array
- Run a check for multiple meta key values
- Create an Array of Specific Custom Post Meta
- Remove Body Classes
- Fetch Record based on meta key dates
- Extend product search with meta in WooCommerce
- how to make members list directory through wordpress post custom meta key.
- Get posts with same meta value as current post
- meta_value_num not ordering all items
- Custom WP_Query for WordPress Search Results with meta_query
- Change order of posts
- Meta query with multiple custom fields for archives page ordering problem
- filter custom field values $min $max
- Query based on custom fields start and end date
- Redirect to another page using contact form 7? [closed]
- Get Data From wp_sitemeta for Multisite network
- Is it possible to retrieve all posts with a certain value for metadata?
- How can I do a variable for meta_query?
- ORDER BY custom field value out of where clause
- Can’t query by meta_key
- ACF: How to get users with a ACF flexible content subfield with a specific value AND layout?
- query_posts with meta_value
- add_query_arg to compare and display events from a certain date
- Displaying an ACF list of users
- Meta value Array
- Custom Query Fields – Altering Meta Value
- How to Convert Custom Fields from Text to Array?
- Custom field outside the loop and inside an array
- Query ACF relationship field – Comparator IN – Value array
- How do i create a custom post query when the meta value is an array?
- Woocommerce products search with custom fields
- WP Query – grouping posts by same meta key, adding together values from another key
- Retrieve all custom field values of a specific custom field metakey as an array, inside WP_Query
- meta_query is overriding default search
- WP_User_Query Orderby Not Working
- WP meta_query args not working in function
- Meta_Query refuses to return results
- Custom WP_query and integrating into theme file
- Query events post type after current date and timezone
- Using custom field as ‘orderby’ value causing post grouping by publish date
- Create custom query for search?
- Filter query based on date in custom field
- query post based on comparison
- WP Query multiple select form – meta_query help
- WordPress Meta Query: Relation is not working correctly
- Show posts containing or not custom field
- Adding custom field to an array
- How do i output images from URL’s added to the same custom field key
- Extract array from custom field
- Filter Query Post by Custom Fields(by date)
- Get posts by meta value except one post [closed]
- WP Query Args – search by meta_key or title