Query the taxonomy terms by ACF field
PHP
<?php $args = array( 'taxonomy' => 'category', 'hide_empty' => false ); $cats = get_categories($args); $cats_has_feature = array(); foreach($cats as $cat){ if (get_field('term_is_feature', 'category_'.$cat->term_id)) { $cats_has_feature[] = $cat; // save the match term in Array } }
Tags:
- acf
- /