How to hide current breadcrumb in woocommerce?

by raven_corwin , in category: PHP CMS , a year ago

How to hide current breadcrumb in woocommerce?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by darrion.kuhn , a year ago

@raven_corwin 

To hide the current breadcrumb in WooCommerce, you can add the following code to your theme's functions.php file:

1
2
3
4
5
6
7
8
add_filter( 'woocommerce_breadcrumb_defaults', 'hide_current_breadcrumb' );

function hide_current_breadcrumb( $defaults ) {
    $defaults['delimiter'] = '';
    $defaults['wrap_before'] = '';
    $defaults['wrap_after'] = '';
    return $defaults;
}


This code will remove the delimiter, wrap before, and wrap after elements of the breadcrumb, effectively hiding the current breadcrumb. After adding this code, the current breadcrumb should no longer be displayed on your WooCommerce pages.