displaying tags in a specific order

13 Views Asked by At

I need help. I want to display tags in a specific order. I have a custom hierarchical taxonomy called "Locations," which I am using to track city, state, and country for photos on my photoblog.

Right now, when the Locations taxonomy shows on a single post, it gets listed in alphabetical order, but I'd prefer it to always display in city, state, country order.

I am a amateur and know very little about coding, but I found this on the internet, and it's been working to display the taxonomy, but I don't know how to get it to always display in city, state, order.

<?php echo get_the_term_list( $post->ID, 'locations', '', ' | ', '</li>' ) ?>

I have standardized how I enter locations into the taxonomy, so it's always parent, child, grandchild (not sure if that's the right terminology, but you get what I mean): so cities are children of states, and states are children of countries. I always enter as such, and there is always only one city, state, and country for any single post (although there may be more than one post with the same city, state, country combo). Also, some posts only have a country and city, or only country, depending on where the photo was actually taken).

Thanks so much.

0

There are 0 best solutions below