问题
There is breadcrumbs on product page and product title just below them. It's too much for one line and I want to hide current crumb like this:
Home->Catalog->Category->Subcategory->
H1 Product Title
回答1:
I found in woocommerce/templates/global/breadcrumb.php the part for $crumb. All is a link, but last is a simple text.
foreach ( $breadcrumb as $key => $crumb ) {
echo $before;
if ( ! empty( $crumb[1] ) && sizeof( $breadcrumb ) !== $key + 1 ) {
echo '<a href="' . esc_url( $crumb[1] ) . '">' . esc_html( $crumb[0] ) . '</a>';
} else {
echo esc_html( $crumb[0] ); // Just replace $crumb here for empty ''
}
echo $after;
if ( sizeof( $breadcrumb ) !== $key + 1 ) {
echo $delimiter;
}
}
回答2:
Add This CSS in Your Active theme.
.woocommerce-breadcrumb { display:none !important; }
Enjoy.!
来源:https://stackoverflow.com/questions/32247636/how-to-hide-current-breadcrumb-in-woocommerce