X

Add custom breadcrumb home url in wooCommerce

Sometimes you may need to change the home URL in the WooCommerce breadcrumbs to a specific URL. This snippet will let you define any page as the home URL using the get_permalink(); function. Just change the ID from 6 to the page ID you want to use, and then add the snippet to the functions.php file of your WordPress theme.

add_filter( 'woocommerce_breadcrumb_home_url', 'woo_custom_breadrumb_home_url' );
function woo_custom_breadrumb_home_url() {
    return get_permalink(6);
}

Comments  Leave a Reply

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!