Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Remove Products list item from Breadcrumb NavXT
/**
* Remove products breadcrumb
*
* @param object $breadcrumb_obj Breadcrumb object.
*/
function my_bcn_after_fill( $breadcrumb_obj ) {
if ( is_category() || is_tag() || is_tax() ) {
foreach ( $breadcrumb_obj->breadcrumbs as $key => $item ) {
if ( 'Products' === $item->get_title() ) {
unset( $breadcrumb_obj->breadcrumbs[ $key ] );
}
}
}
}
add_action( 'bcn_after_fill', 'my_bcn_after_fill' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.