I have tried the following but to no avail:
http://www.advancedcustomfields.com/resources/querying-the-database-for-repeater-sub-field-values/
My repeater is setup as shown in the attached image.
Serving is a repeater field. Serveinfo is a layout that allows you to insert a year a state legislator served and for what branch (i.e. House or Senate, as well as some other fields, but disregard those).
I need to be able to write a query to get posts of type ‘legislator’ that have a year and type of a defined value (I.e. Senators of 2013, House members of 2014, etc).
I can do WP Queries with ACF regular fields no problem, but am stumped when it comes to flexible fields.
Hi @signups3,
Thanks for the post.
In this kind of query it is highly recommended to create a custom filter to replace the standard ‘=’ with ‘LIKE’ and this is to allow for a WILDCARD in the meta_key search.
This has also been described with examples here: https://www.advancedcustomfields.com/resources/query-posts-custom-fields/