I have a question about how to echo a child taxonomy only.
My taxonomy is location.
I have a parent location and child locations like so:
West London (Child)
- Chelsea (Grandchild)
I need to echo just the last term (in the case above, it's Chelsea).
At present the code I am using is:
$terms_as_text = get_the_term_list( $post->ID, 'location', '', ', ', '' ) ; echo strip_tags($terms_as_text);
Unfortunately, this echo's both parens/superiors as well.
How would i display just the last child term?
Many Thanks in advance