get_the_terms Ordering
-
I am using the Salient wordpress theme which we are trying to re-use its ‘Project Attributes’ list.
This is the code that outputs our list for each portfolio item:
<?php $project_attrs = get_the_terms( $post->ID, 'project-attributes' ); if (!empty($project_attrs)){ ?> <div data-color="accent-color" data-animation="true" data-list-icon="icon-angle-right" class="nectar-fancy-ul"> <ul> <?php foreach($project_attrs as $attr){ echo '<li>' . $attr->name . '</li>'; } ?> </ul> </div> <?php } ?>
Essentially we would like it to be listed hierarchically instead of A-Z but everything I try fails.
Any help would be appreciated.
Thanks heaps.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘get_the_terms Ordering’ is closed to new replies.