I think the query i am after is a little more complicated. I am trying to do a GROUP BY on a repeater field subfield value.
My data is setup like this:
custom post type called “companies”.
In the post type i have a repeater field called “Locations”.
In the locations repeater field I have address, city, state, zipcode — all of the address information.
I am building a map so I want to show all results grouped by state. Ideally, I’d be able to show what all states are in my repeater field and show the count of how companies are in that location.
I’m finding it a bit tricky to group by the repeater state sub_field that I’ve created. Any ideas how to do that?
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!