diff --git a/src/functions/breadcrumb.php b/src/functions/breadcrumb.php
index b3f7fda..ef2ce2d 100644
--- a/src/functions/breadcrumb.php
+++ b/src/functions/breadcrumb.php
@@ -62,11 +62,35 @@ function tainacan_interface_the_breadcrumb() {
} elseif ( !is_single() && !is_page() && get_post_type() != 'post' && !is_404() ) {
$post_type = get_post_type_object(get_post_type());
- if(!is_page() && get_post_type() != 'tainacan-collection') {
+ if(is_tax()) {
+ $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
+ $taxonomy = get_taxonomy( $term->taxonomy );
+ echo ''; _e( 'Taxonomy: ', 'tainacan-interface' ); echo $taxonomy->labels->name; echo ' ' . $delimiter . ' ';
+ // 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 ''.$item->name.'';
+ endforeach;
+ endif;
+ // Display the current term in the breadcrumb
+ echo $before . $term->name . $after;
+ } elseif(!is_tax() && get_post_type() != 'tainacan-collection') {
echo ''; _e( 'Collections', 'tainacan-interface' ); echo ' ' . $delimiter . ' ';
- }
- echo $before . $post_type->labels->singular_name . $after;
+ echo $before . $post_type->labels->singular_name . $after;
+ } else {
+ echo $before . $post_type->labels->singular_name . $after;
+ }
} elseif ( is_attachment() ) {
$parent = get_post($post->post_parent);
$cat = get_the_category($parent->ID); $cat = $cat[0];