Reputation: 63
Right now on my woocommerce shop the breadcrumb reads "Home > Shop > Product Category > Product > etc".
I Would like to remove the home link so the breadcrumb trail starts with "Shop" as the first link.
Thanks!
Upvotes: 3
Views: 6263
Reputation: 1
function remove_home_from_breadcrumbs($defaults) {
$defaults['home'] = '';
return $defaults;
}
add_filter('woocommerce_breadcrumb_defaults', 'remove_home_from_breadcrumbs');
Upvotes: 0
Reputation: 78
You can also directly pass an empty string to the woocommerce_breadcrumb
function.
<?php woocommerce_breadcrumb( array( 'home' => '' ) ); ?>
The function take an home
argument and if this argument is empty, the home link isn't added, see: https://github.com/woocommerce/woocommerce/blob/master/includes/wc-template-functions.php#L2237
Upvotes: 1
Reputation: 113
add_filter('woocommerce_breadcrumb_defaults', function( $defaults ) {
unset($defaults['home']); //removes home link.
return $defaults; //returns rest of links
});
the above code goes to your functions.php.
Upvotes: 6