[GENESIS] Removing title from breadcrumbs on product pages

[ad_1]

I’ve searched google, asked Chat GPT-4 and cannot find a solution to remove title from genesis breadcrumbs on product page. My temporary fix is:

/*temporary fix removing title from breadcrumbs on product pages*/
.product-template-default .breadcrumb {
white-space: nowrap;
overflow: hidden;
}
.product-template-default .breadcrumb>span:last-of-type:before {
content: ‘ ‘;
width: 9999px;
display: inline-block;
}

Firstly I tried removing it modyfing functions.php file, by using preg\_replace function, but it seems I cannot get access to breadcrumbs string to modify it. My hopeless trials looked like this:

add_filter( ‘genesis_page_crumb’, ‘custom_remove_product_title_from_breadcrumbs’, 10, 2 );
function custom_remove_product_title_from_breadcrumbs( $crumb, $args ){
if (is_product()) {
return preg_replace(‘/ \<span aria\-label\=\”breadcrumb separator\”\>\/\<\/span\> [^\<]+/’, ”, $crumb);
}
}

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer