diff --git a/templates/global/breadcrumb.php b/templates/global/breadcrumb.php
index 8a758acd361..ea63566aee8 100644
--- a/templates/global/breadcrumb.php
+++ b/templates/global/breadcrumb.php
@@ -5,6 +5,7 @@
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.2.0
+ * @see woocommerce_breadcrumb()
*/
if ( ! defined( 'ABSPATH' ) ) {
@@ -31,7 +32,7 @@ if ( ( ! is_front_page() && ! ( is_post_type_archive() && get_option( 'page_on_f
echo $before . '' . $home . '' . $after . $delimiter;
}
- if( is_home() ) {
+ if ( is_home() ) {
echo $before . single_post_title('', false) . $after;
@@ -43,7 +44,7 @@ if ( ( ! is_front_page() && ! ( is_post_type_archive() && get_option( 'page_on_f
if ( 0 != $this_category->parent ) {
$parent_category = get_category( $this_category->parent );
if ( ( $parents = get_category_parents( $parent_category, TRUE, $after . $delimiter . $before ) ) && ! is_wp_error( $parents ) ) {
- echo $before . $parents . $after . $delimiter;
+ echo $before . trim( $parents, $after . $delimiter . $before ) . $after . $delimiter;
}
}
@@ -144,7 +145,7 @@ if ( ( ! is_front_page() && ! ( is_post_type_archive() && get_option( 'page_on_f
$cat = current( get_the_category() );
if ( ( $parents = get_category_parents( $cat, TRUE, $after . $delimiter . $before ) ) && ! is_wp_error( $parents ) ) {
- echo $before . $parents . $after . $delimiter;
+ echo $before . trim( $parents, $after . $delimiter . $before ) . $after . $delimiter;
}
echo $before . get_the_title() . $after;
@@ -168,7 +169,7 @@ if ( ( ! is_front_page() && ! ( is_post_type_archive() && get_option( 'page_on_f
$cat = get_the_category( $parent->ID );
$cat = $cat[0];
if ( ( $parents = get_category_parents( $cat, TRUE, $after . $delimiter . $before ) ) && ! is_wp_error( $parents ) ) {
- echo $before . $parents . $after . $delimiter;
+ echo $before . trim( $parents, $after . $delimiter . $before ) . $after . $delimiter;
}
echo $before . '' . $parent->post_title . '' . $after . $delimiter;
echo $before . get_the_title() . $after;