Displaying Hierarchical custom taxonomy

If you want to sort your terms by hierarchy, you can use wp_get_post_terms() instead.

It’s usage is similar to get_the_term_list(). Take a look at this simple example:

wp_get_post_terms( $post->ID, $taxonomy->name, array( 'orderby' => 'term_id' ) );

I think we can safely assume that the parent will mostly have a lower ID of its childs (if not manually changed), so this will do the trick. But if the post belongs to several parents, then this will break again.

Take a look at the relative codex page for more information about this function.

error code: 523