удалить название товара в хлебных крошках
Wed Jan 05 2022 08:33:42 GMT+0000 (Coordinated Universal Time)
Saved by
@mastaklance
/**
* Remove Product Title From Breadcrumbs
*/
add_filter( 'woocommerce_get_breadcrumb', 'bbloomer_single_product_edit_prod_name_breadcrumbs', 9999, 2 );
function bbloomer_single_product_edit_prod_name_breadcrumbs( $crumbs, $breadcrumb ) {
if ( is_product() ) {
global $product;
$index = count( $crumbs ) - 1; // product name is always last item
$value = $crumbs[$index];
$crumbs[$index][0] = null;
}
return $crumbs;
}
/**
* Remove Separators (add custom by css)
*/
add_filter( 'woocommerce_breadcrumb_defaults', 'wcc_change_breadcrumb_delimiter' );
function wcc_change_breadcrumb_delimiter( $defaults ) {
// Change the breadcrumb delimeter from '/' to null
$defaults['delimiter'] = null;
return $defaults;
}
content_copyCOPY
/*------------------------------------*\
# Breadcrumbs
\*------------------------------------*/
#single-breadcrumbs a:hover {
color: var( --e-global-color-primary );
}
/* add custom separator if remove in function.php */
.woocommerce-breadcrumb a:not(:last-child):after {
content: '/';
margin: 0 5px;
}
/* Remove separator after the product type selection for Virtual and Downloadable Checkboxe in single product */
#woocommerce-product-data .hndle label:first-child {
border-right: 0;
}
Comments