Function Reference: geodir_taxonomy_breadcrumb
Summary
Generates breadcrumb for taxonomy (category, tags etc.) pages.
Package
GeoDirectory
Change Log
Since: 1.0.0
Source File
geodir_taxonomy_breadcrumb() is located in geodirectory-functions/general_functions.php [Line: 1182]
Source Code
function geodir_taxonomy_breadcrumb() { $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); $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 ); foreach ( $parents as $parent ): $item = get_term_by( 'id', $parent, get_query_var( 'taxonomy' ) ); $url = get_term_link( $item, get_query_var( 'taxonomy' ) ); echo '