Home › Forums › Front-end Issues › Hide empty categories › Reply To: Hide empty categories
The problem in the OP is likely due to the fact that artists can share categories, so while one may not have anything in a category others might making them non empty.
There isn’t really any way to do what you want to do directly.
What you would need to do is get all of the media posts related to the artist then loop over all of them to get collect a list of categories and then use this in the “include” argument for getting the terms.
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.