did you try to call like this:
$args = array(
'post_type' => 'product',
'meta_query' => array(
'relation' => 'OR',
array(
'key' => 'spec',
'value' => 'choice2',
'compare' => 'LIKE',
),
array(
'key' => 'spec',
'value' => 'choice3',
'compare' => 'LIKE',
),
),
);
$query = new WP_Query( $args );
example taken straigh from the codex
Related Posts:
- Copying Custom Meta Values from existing post to a duplicate post
- Unable to show ACF’s Image Custom Field properly in Genesis Framework [closed]
- ACF: How to get the full field name (meta_key) by a field key?
- WordPress creates new lines in postmeta table on post update
- How to get custom image field of specific post id
- Query Posts based on custom field value
- save all acf options in one meta_value [closed]
- Can I exclude a post by meta key using pre_get_posts function?
- What is the index [0] for on post meta fields?
- Add custom field to the archive page?
- Matching Serialized Arrays with meta_query
- Custom field metabox not showing in back-end
- So much data in postmeta
- How to hide meta box values from custom fields list?
- get_post_meta() unserialize issue – returns boolean(false)
- What is the advantage of the wp_options design pattern?
- Unable to get Preview of Uploaded image within a Custom Meta box
- Meta keywords and descriptions plugin for manually editing meta for each page/post
- Up/Down voting system for WordPress
- Change content before writing to database
- post meta data clearing on autosave
- Display info from custom fields in all images’ HTML
- Order Custom post type loop by custom field (datepicker)
- Update meta values with AJAX
- Custom fields to save multiple values
- ACF Upload Image in repeater from front-end with custom form? – add_post_meta()
- Login & Register & Custom details WITHOUT plugin
- wp_handle_upload error “Specified file failed upload test” but still creates attachment?
- Which is best in the following scenario : post_meta vs custom table vs parent/child posts
- Saving custom image meta fields
- Get all meta keys assigned to a post type
- Update posts after populating ACF field value [closed]
- WP Custom Fields Metabox Disappears – ACF plugin issue [closed]
- Transfer self made functions.php custom fields to Advanced Custom Fields [closed]
- Adding custom fields (post meta) before/during wp_insert_post()
- How to query posts with certain custom meta data, and output Post data
- Will loading too many ACF Fields cause slow down?
- post meta getting deleted on save
- Custom field not updating when value is empty
- meta_compare seems to be treating values as strings instead of integers as expected
- Limit the number of acf content when displaying in post loop [closed]
- How to add custom metadata text box dropdown to sidebar in Gutenberg editor for all post types
- Add post meta fields, when creating a post using WordPress’ REST API
- Store array as single, serialized post meta field or many post meta fields?
- Custom Field Values not updating unless I click “Update” twice
- Get an advanced custom field after post publish
- How to create a dropdown select of all items in an ACF field group
- update_post_meta for repeated custom field [closed]
- Trying to update_post_meta function
- Show values of custom post meta on ‘Add new post’ page?
- Sort custom post type by multiple custom fields
- Custom post meta field effect on the performance on the post
- get_posts in meta box dropdown not showing latest posts
- Limits, not all post are showen when querying for posts by view count
- Display Custom Meta Box Field Only If Value is Present
- Ordering posts by custom field named “date” in backend
- Advanced Custom Fields WYSIWYG More tag
- IF Custom field value equals ZERO
- How to use media upload on metabox post page without breaking TinyMCE?
- Let’s Create Custom Field Template Documentation
- Branch made by several custom values
- Looping inside block return
- How to copy data from a custom field to the post_content?
- Can I save post meta programatically without setting metaboxes?
- Insert image into sub-field with update_post_meta
- How to Pass values to Custom Field through PHP in WordPress Posts?
- Advanced Custom fields not available yet during publish_page action
- Meta box values are displayed on Custom Fields list. Is it possible to hide them?
- Best way to achieve multiple links in a post title
- How can I add/update post meta in a admin menu page?
- Get author total post votes from post meta
- custom filed from post in the side bar
- Rewrite comment form post ID on submit
- What am I missing in this Code Block?
- How to show ACF fields in Gridbuilder custom block
- How to display custom fields in hestia theme
- Shortcode for Custom Field of Media Attachment (to use with Featured Images)
- How to speed up post list slowed by update_meta_cache()?
- WordPress Blocks, setAttributes not saving
- SQL query to change the value of a Custom Field
- Custom meta POST request fired twice when updating a post in Gutenberg
- Add custom field information to source meta data
- Create Meta boxes dynamically
- How to delete attachments associated with custom field type when post property changes? [closed]
- Page template is missing fields or is invalid when I updating the template
- Delete custom meta
- Check if value exists before saving
- Get meta value when the page is a blog archive
- WordPress taxonomy child image
- Filter and display a specific custom field value [closed]
- wordpress simple post multi rating with post_meta and user_meta
- Query Posts Via WordPress URL
- I want to add a custom field in the rss title of each post, but don’t want it to be shown on the site
- Custom fields / meta box output
- Colecting values from custom field checkboxes and displaying them in the post
- Build Array from Input Fields question
- How can i put a custom field inside this php
- acf_form() – “On Update” action [closed]
- WP Query Args – search by meta_key or title
- ACF in radio button cf7