Oxygen comes with a handy WooCommerce Breadcrumb component that displays breadcrumbs like this:

You would most likely want to change the “Home” text to something like “Shop” and have it link to /shop/ instead of the site’s homepage.

Here’s how.

Install and activate Code Snippets.

Add a new Snippet.

Title: Change Home text and link in WooCommerce breadcrumbs

Code:

add_filter( 'woocommerce_breadcrumb_defaults', 'woo_change_breadcrumb_home_text' );
/**
 * Change the breadcrumb home text from "Home" to "Shop".
 * @param  array $defaults The default array items.
 * @return array           Modified array
 */
function woo_change_breadcrumb_home_text( $defaults ) {
	$defaults['home'] = 'Shop';

	return $defaults;
}

add_filter( 'woocommerce_breadcrumb_home_url', 'woo_custom_breadrumb_home_url' );
/**
 * Change the breadcrumb home link URL from / to /shop.
 * @return string New URL for Home link item.
 */
function woo_custom_breadrumb_home_url() {
	return '/shop/';
}

Save changes and activate.

Source: https://docs.woocommerce.com/document/customise-the-woocommerce-breadcrumb/

Need help implementing a tutorial in your site or want to hire me for custom work?

HIRE ME

Find the article helpful and wish to donate?

DONATE
magnifiercross
>
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram
%d bloggers like this: