
How To Remove Product Name From Breadcrumbs in Woocommerce
If you need to remove last element from breadcrumbs, you must:1. In the folder with your theme, create a folders "woocommerce/global"
wp-content/themes/your-theme/woocommerce/global
2. Then copy ffrom Woocommerce plugin (or just create) file "breadcrumbs.php"
wp-content/themes/your-theme/woocommerce/global/breadcrumbs.php
3. Replace (paste) the next code in breadcrumbs.php:
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! empty( $breadcrumb ) ) {
echo $wrap_before;
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 {
if(!is_singular()){
echo esc_html( $crumb[0] );
...