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
- Using meta query (‘meta_query’) with a search query (‘s’)
- 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
- ORDER BY custom field value
- Filter WP_Query for posts having a certain meta-value
- Add custom fields to search
- SELECT max(meta_value) FROM wp_postmeta WHERE meta_key=’price’… stops working when value is over 999
- Matching Serialized Arrays with meta_query
- WP_Query orderby custom field then post_date in one query
- Filtering a WP_Query meta_query by numeric values isn’t working
- Getting attachments by meta value
- When using add_post_meta and update_post_meta, is there any way to give the individual arrays keys?
- WP doesn’t show Array Custom Fields?
- How to query serialized array by comparing greater than (>=)?
- querying with custom meta field with meta_query
- Is it possible to store arrays in a custom field?
- How do I order by multiple custom fields using wp_query?
- Order by meta_value_num DESC and meta_value ASC on WP 4.0
- Query meta field using between
- Order Posts by Closest Numeric Values
- Is there a way to do multiple ordering on a multiple meta_query?
- 2 orderby in wp_query with 2 custom fields
- Can serialized arrays in DB be matched against serialized arrays with meta_query?
- How to get a meta value from all post
- WordPress Search Custom Meta Field Only
- WordPress altering my custom query, How to fix it?
- Ordering posts by anniversary using only day and month
- WP Meta Query for some meta (array) values
- Calling Specific Pages with wp query Part II
- WP_Query multiple use of relation and/or
- Loop through two different sets of custom fields
- Query Problem – Show posts within category ‘x’ that have a custom field between ‘y’ and ‘z’
- Comparing timestamps in meta query doesn’t work
- Display two post types ordered by two custom fields
- Querying by taxonomy vs Querying by Custom fields Speed Comparison
- meta_query with array as value
- use get_posts to get custom field data, but in one array
- Slow meta query with multi meta keys
- 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
- Saving an array in a single custom field
- Displaying posts with only upcoming dates according their custom field date value
- How to filter a dd/mm/yyyy date from a custom field in a query
- meta_key and meta_value not working together
- Using WP Query to search by multiple meta fields
- How add a custom posttype name using ACF field to a query post array
- Sorting posts by multiple values, combined
- Compare WP Custom Field date
- meta_value_num sort glitch
- Sort by posts that have a featured image?
- Order by value in serialized custom field
- Can an array be used as a meta_query value?
- Which is best in the following scenario : post_meta vs custom table vs parent/child posts
- WP_Meta_Query causing long-running MySQL queries
- $wp_query meta_key naming issue [closed]
- Author Page Custom Query WHERE author OR [post meta value] OR [post meta value]
- Meta_query and numeric comparison [closed]
- Order Posts by meta value AND published date
- Sorting posts by custom fields in meta_query
- Filtering by Post Meta Custom Fields – Performance
- 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
- Adding Custom Fields to Search
- Upcoming Event: How do I sort database by custom date field, but ignore past dates?
- Any way to include custom fields in WP_Query results?
- Complex WP_User_Query call fails on production server
- Multiple relationships in a query
- Get specific custom field keys from a post and put into an array
- How do I use wp_query for WordPress search?
- Passing Custom Field Data as Array to be Saved (Resulting Custom Field Array is inconsistent)
- Orderby custom field meta value ASC and then by date DESC
- Conditional custom field query
- Order query by meta_value with multiple custom fields
- WP_Query: include custom post type only with specific meta value
- Returning a list of custom post types excluding those without a specific meta_value
- How to make Meta Query case sensitive?
- Adding an array from a query string to a WP meta_query
- 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
- How make a custom search on backend in WordPress without plugin?
- Auto Populate Custom Field with Complex Value That Increase by One?
- How to add a new meta key and assign timestamp to posts