Support

Account

Home Forums ACF PRO Ordering taxonomy terms Reply To: Ordering taxonomy terms

  • I figured it out… for anyone that’s looking for the answer:

    <?php
    
    $terms = get_field('portfolio');
                     
                                     usort($terms, function($a, $b) {return strcmp($a->name, $b->name);});
                                     if( $terms ):
                                         echo '<ul>';
                     
                                         foreach( $terms as $term ):
                     
                                           echo '<li>';
                     
                                             $name = $term->name;
                     
                                             echo $name;
                     
                                           echo '</li>';
                  
                                         endforeach;
                                         echo '</ul>';
                                     endif;
    
    ?>