From 50669050101995e4b72b278b984fef338284e829 Mon Sep 17 00:00:00 2001 From: Rodrigo de Oliveira Date: Sun, 25 Apr 2021 00:43:31 -0300 Subject: [PATCH] Fixes repository level page breadcrumb (ref #40) --- src/functions/breadcrumb.php | 17 +- src/header.php | 2 +- src/languages/pt_BR.mo | Bin 24114 -> 24086 bytes src/languages/pt_BR.po | 737 ++++++++++++++++++++++------------- 4 files changed, 484 insertions(+), 272 deletions(-) diff --git a/src/functions/breadcrumb.php b/src/functions/breadcrumb.php index 9e9f40e..d180f7a 100644 --- a/src/functions/breadcrumb.php +++ b/src/functions/breadcrumb.php @@ -2,7 +2,7 @@ /** The breadcrumb function * Display parent and current page - **/ + **/ function tainacan_interface_the_breadcrumb() { $showOnHome = 0; // 1 - show breadcrumbs on the homepage, 0 - don't show $delimiter = '>'; // delimiter between crumbs @@ -73,7 +73,7 @@ function tainacan_interface_the_breadcrumb() { $parents = array_reverse($parents); // For each parent, create a breadcrumb item - foreach( $parents as $parent ) : + foreach ($parents as $parent): //$item = get_term_by( 'id', $parent, get_query_var( 'taxonomy' )); $url = get_term_link($parent); echo ' ' . $delimiter . ' '; @@ -84,9 +84,16 @@ function tainacan_interface_the_breadcrumb() { echo ' ' . $delimiter . ' '; 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 ''; + _e( 'Collections', 'tainacan-interface' ); + echo ' ' . $delimiter . ' '; + + if (is_post_type_archive()) { + $str = $post_type->labels->singular_name; + } else { + $str = __('All items', 'tainacan-interface'); + } + echo $before . $str . $after; } else { echo $before . $post_type->labels->singular_name . $after; } diff --git a/src/header.php b/src/header.php index 0eb19e7..a9193cb 100644 --- a/src/header.php +++ b/src/header.php @@ -47,7 +47,7 @@ -
+