Replace Woocommerce Breadcrumbs in Storefront Theme with Yoast SEO Breadcrumbs

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.

Customized Yoast SEO Breadcrumbs

Share:
This entry was posted in Templates, WordPress and tagged . Bookmark the permalink.

9 Responses to Replace Woocommerce Breadcrumbs in Storefront Theme with Yoast SEO Breadcrumbs

  1. Ruth Maude says:

    Thanks for this. It was just what I was looking for.

  2. Reuben says:

    I had an issue with the home icon appearing before each breadcrumb. Any thoughts on why this was happening?

  3. Karen says:

    Same problem with home icon appearing before each breadcrumb. Anyone find a solution?

  4. 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

Leave a Reply

Your email address will not be published. Required fields are marked *