Home › Forums › General Issues › Counting ACF fields with values › Reply To: Counting ACF fields with values
I wouldn’t be able to give you sql for this. If a field can have different values the only way that I can think of to count each of the possible values is to
1) Do a query for all posts of the post type
2) Loop over each post
3) Get the field for each post
4) Loop over the values and count the ones that are selected
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.