Regular woocommerce function to disable their breadcrumbs doesn’t work with Storefront theme. Here’s a function to remove them from Storefront and to enable Yoast Seo plugin breadcrumbs, that usually work better and enable more options for customization.
This is for latest Woocommerce 2.5.2, Yoast Seo and Storefront versions.
// Replace WooThemes Breadcrumbs with Yoast breadcrumbs
add_action( 'init', 'fixcss_breadcrumbs' );
function fixcss_breadcrumbs() {
remove_action('storefront_content_top', 'woocommerce_breadcrumb', 10);
add_action( 'storefront_content_top','fixcss_yoast_breadcrumb', 20, 0);
function fixcss_yoast_breadcrumb() {
if ( function_exists('yoast_breadcrumb') && !is_front_page() ) {
yoast_breadcrumb('<nav class="breadcrumbs woocommerce-breadcrumb">','</nav>');
}
}
}
Using nav
and woocommerce-breadcrumb
class allows to use Storefront themeĀ previous styles for breadcrumbs. And you may customize it further from Yoast advanced options.
Thanks for this. It was just what I was looking for.
I had an issue with the home icon appearing before each breadcrumb. Any thoughts on why this was happening?
Yes, I had it too, they changed css for breadcrumbs recently
Have you figured out a solution? Thanks.
yes, but don’t remember already, some css
Same problem with home icon appearing before each breadcrumb. Anyone find a solution?
You may want to try
.woocommerce-breadcrumb a:first-of-type::before {
display: none;
}
Can someone tell me where to place the code to remove the bread crumbs ? I am new to all of this and it did not say as far as I could see ??
Thank you in advance
In functions.php of your child-theme.