Support

Account

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.