Add this function to the functions.php file in your current theme:
/* Taxonomy Breadcrumb */ function id_taxonomy_breadcrumb() { // Get the current term $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); // Create a list of all the term's parents $parent = $term->parent; while ($parent): $parents[] = $parent; $new_parent = get_term_by( 'id', $parent, get_query_var( 'taxonomy' )); $parent = $new_parent->parent; endwhile; if(!empty($parents)): $parents = array_reverse($parents); // For each parent, create a breadcrumb item foreach ($parents as $parent): $item = get_term_by( 'id', $parent, get_query_var( 'taxonomy' )); $url = get_bloginfo('url').'/'.$item->taxonomy.'/'.$item->slug; echo '<a href="'.$url.'">'.$item->name.'</a> / '; endforeach; endif; // Display the current term in the breadcrumb echo $term->name; }
And the call it in the temlate:
<?php id_taxonomy_breadcrumb(); ?>