I know this is an old question, but I thought I’d post the answer in case anybody else is facing the same problem.
functions.php:
function add_cond_to_where( $where ) {
//Replace showings_$ with repeater_slug_$
$where = str_replace("meta_key = 'showings_$", "meta_key LIKE 'showings_%", $where);
return $where;
}
add_filter('posts_where', 'add_cond_to_where');
Query:
//Replace showings_$ with repeater_slug_$
//Replace _discounts with _sub_element_slug
$args = array(
'meta_query' => array(
array(
'key' => 'showings_$_discount',
'value' => 'students',
'compare' => '='
)
)
);
Reference: https://www.advancedcustomfields.com/resources/query-posts-custom-fields
I hope this helps,
Cheers!
Related Posts:
- Linking posts together with Advanced Custom Fields “both ways”
- How to use a custom post type as front page?
- Filtering a WP_Query meta_query by numeric values isn’t working
- Querying Posts by Taxonomy From Alternate Network Site
- Comparing timestamps in meta query doesn’t work
- Display two post types ordered by two custom fields
- Include both default and Custom Post Type in query modified inside pre_get_posts
- Query current and future events, ordered by begin date
- Having trouble with custom date field for CPT query (WordPress)
- Display posts if a custom field value is equal to another custom field value
- WP_Query search posts by custom post type and custom taxonomy
- Calculating Bayesian average for custom post type
- Conditional to modify query results
- Is it possible to create a shortcode that will query a post based on taxonomies?
- Remove duplicated values from a loop
- Querying Term Posts in Loop
- Use get_post_types to query only custom posts types
- WordPress Orderby Numeric Value Not Working
- Custom Post Types not showing, custom WP_Query
- Custom Post type and Custom Field WP_Query
- Display multiple custom post types and sort them chronological by one of their fields
- convert custom query to wp_query
- Search / Filter posts on Title/Content OR Tags
- WP_Query order by custom field, then randomly order some of results
- creat filter with wp_query
- Troubles with acf/save_post and WP_Query
- Query custom post type with ACF Date
- Stuck in Order by more then one
- Order Custom Post Type by Custom Field Value
- Query Custom Post Type Taxonomy term with multiple parameters
- First custom field value (out of several) displayed twice after query
- Prioritize posts in query by meta keys?
- WP_Query orderby and tax_query
- Different Ways to Query Custom Post Types?
- Query based on custom fields start and end date
- Showing specific post in order of array wp_query
- Why is my WP Query not returning first result’s post meta?
- WP_Query() with custom post type and taxonomy — get all terms?
- Returning a custom content types with meta values
- Group by custom field value (start and end times)
- Create query for both custom post type and category
- Using WP meta query to show custom post types by a start and finish date
- Query custom posts from custom taxonomy
- Is there a (preferable built-in) way to check what custom queries are used in a theme?
- Query filter by value in meta_value array
- Change search query in wordpress custom post type
- Create if else for post types in WP_Query ‘post__in’ values
- WP Query from two Custom Post type fields as statement
- Sort custom posts by date and then by taxonomy
- WP Query: If field X is empty, show posts based on field Y
- Using ACF values in nested WP queries for CPT with date values in the past
- How select query is generated in a Custom Post Type?
- Filter posts by their related field’s custom field
- WP_Query for custom taxonomies showing posts from non-specified terms?
- How to hide sub fields in a field group and also the entire field group if the answer selected is “no”
- WP_Query with all posts in one custom post type and only posts in another custom post type with a specific category
- Wrapping an unknown amount of posts inside separate HTML Containers during WP_Query loop
- Show specific posts with WP_Query using ACF Post object
- post type => ‘any’ not applied my custom queries
- Custom Field as Custom Post type element class
- How do I display specific custom posts, and how do I edit a post’s singular page?
- Get posts of an specific term of a custom taxonomy
- Conditional posts in WP_query for search
- Query Pulling the same post twice
- Is it possible to add query parameters on the archive page?
- How to query posts by meta keys AND under specific category?
- $post breaking container loop
- Query child posts on parents single.php?
- Query Posts From Multiple Post Types
- WordPress can only query up to 766
- Custom Post-type not returning the right child_of
- Filter Custom post type by another Custom post type
- Create a list of months based posts
- Display ACF object field data using Elementor Custom Query
- WordPress WP_Query Sort by 2 dates – custom fields
- Load posts via AJAX without draft status
- Query Multiple Post Types and Paginate Newly Created List
- WordPress custom post type -> query and sort by custom field with multiple values, then published date
- WordPress duplicating posts from single loop
- Use Custom Field to Display Post Loop
- Custom fields disappearing when a custom post type is assigned
- Wrong request query on cpt and tax
- How can I dynamically add a post to a custom post type which uses a custom field?
- Problem with WordPress query on page using custom fields
- Previous/Next Link by Meta Value in CPT
- the_content() not outputting anything (Advanced Custom Fields)
- Show custom post type filtered by category
- Randomize Posts. Skip the first post in ascending order
- Creating a navigation menu of all posts of a custom post type and their children posts?
- Get custom taxonomies from multiple posts
- Making certain categories of CPT not publicly queryable
- Pagination for Custom Taxonomy Page [duplicate]
- Filtering WP_Query
- Pagination on with query_posts in custom post type template
- Wp_query: sort by PHP variable
- WP_Query most viewed posts, in multiple Post Types, last 30 days, excluding a specific taxonomy term
- Custom-Posttype & Custom Taxonomy WP_Query
- Crafting WP_Query array, sort by date
- Custom loop with multiple taxonomy queries
- Return one unique custom post type result when it shares a custom taxonomy in WP_QUERY?