Skip to content

Instantly share code, notes, and snippets.

@rubel306
Last active November 13, 2018 15:56
Show Gist options
  • Save rubel306/7bf3cb8cbabddbe1eafb0eff26daf139 to your computer and use it in GitHub Desktop.
Save rubel306/7bf3cb8cbabddbe1eafb0eff26daf139 to your computer and use it in GitHub Desktop.
/**
* Change several of the breadcrumb defaults
*/
add_filter( 'woocommerce_breadcrumb_defaults', 'woor_woocommerce_breadcrumbs' );
function woor_woocommerce_breadcrumbs() {
return array(
'delimiter' => ' / ',
'wrap_before' => '<div class="breadcrumb">
<div class="container">
<div class="breadcrumb-inner">
<ul class="list-inline list-unstyled">',
'wrap_after' => '</ul>
</div>
</div>
</div>',
'before' => '',
'after' => '',
'home' => _x( 'Home', 'breadcrumb', 'woocommerce' ),
);
}
//call woocommerce function
<?php woocommerce_breadcrumb(); ?>
//remove shop page default breadcrumb
/**
* Remove the breadcrumbs
*/
add_action( 'init', 'woor_remove_wc_breadcrumbs' );
function woor_remove_wc_breadcrumbs() {
remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment