Home › Forums › Add-ons › Repeater Field › Why is my meta query only looking at the first index of my repeater field › Reply To: Why is my meta query only looking at the first index of my repeater field
Because you’re using
0 represents the first row of the repeater.
WP has recently added the ability to query the meta key using “LIKE” https://make.wordpress.org/core/2019/01/23/like-support-for-meta-keys-in-5-1/, but to be honest, I don’t think it will work on repeaters and you’re probably still going to need to use the example from this doc https://www.advancedcustomfields.com/resources/query-posts-custom-fields/ there is a section on repeater sub fields there.
But, then again, I would do this https://acfextras.com/dont-query-repeaters/, but if you’ve already got a lot of data in the site it would mean updating every post. It’s something that you need to plan for ahead of time.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
© 2022 Advanced Custom Fields.