Home › Forums › ACF PRO › Output taxonomy terms by a meta field value › Reply To: Output taxonomy terms by a meta field value
This will only work if your using ACF >= 5.5.0
The first thing you need is a list of terms country terms using get_terms() https://developer.wordpress.org/reference/functions/get_terms/
The next step is to loop though the list counties and do another get_terms() with a meta_query value to match the country. The meta_query follows the same syntax as meta_query for WP_Query() https://codex.wordpress.org/Class_Reference/WP_Query
If you’re not using ACF5 this will be far more complicated.You’ll need to get all of the city terms and then loop through them manually and get the custom field for each one and short them all by country.
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.