Show Top Level Parent Taxonomy
-
Hello,
I am currently using the following code to show the parent term of the current taxonomy term.
<?php $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); $parent = get_term($term->parent, get_query_var('taxonomy') ); echo $parent->name; ?>
I would also like to include the top level parent of the terms.
For this particular set up I am using zip codes, city and state.
Taxonomy set up is as follows:
State
->City
–>Zip CodeCurrently I have it displaying on the page as Zip Code, City
I would like to display Zip code, City, State
Any ideas on what additional code will help me accomplish this, I am currently stuck. Thanks in advance!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Show Top Level Parent Taxonomy’ is closed to new replies.