Rob
Rob

Reputation: 6370

Change the Woocommerce breadcrumb link

I'm using the following snippet to change the URL but I want to make it dynamic rather than hard coding a link in.

add_filter( 'woocommerce_breadcrumb_home_url', 'woo_custom_breadrumb_home_url' );
function woo_custom_breadrumb_home_url() {
    return 'http://woothemes.com';
}

I tried the following which not only breaks the link but it appears in the top of the screen.

$breadcrumb = bloginfo('url');
add_filter( 'woocommerce_breadcrumb_home_url', 'woo_custom_breadrumb_home_url' );
function woo_custom_breadrumb_home_url() {
    return '$breadcrumb';
}

How can I make the Home link dynamic?

Upvotes: 1

Views: 690

Answers (1)

Bridget Arrington
Bridget Arrington

Reputation: 444

You can try

return home_url();

This should give you the same address as bloginfo('url')

Upvotes: 1

Related Questions