Home Forums WoodMart support forum Problem with Woocommerce Shop page Reply To: Problem with Woocommerce Shop page

#600072

jdiproduction.gr
Participant

Hello I tried disabling every unnecessary plugin, I only left Elementor, Woocommerce and Woodmart Core which didn’t change anything. Since we have written quite a bit of custom code in the functions.php I checked there the same way each chunk of code for each functionality. I haven’t figured out why but the following code which is to shorten the titles of products caused it, when I commented it out the bug got fixed.

// Shorten product titles
add_filter(‘the_title’, ‘shorte
function shorten_woo_product_ti
if (!is_singular(array(‘product
$length = 50;
if (mb_strlen($title, ‘UTF-8’)
$title = mb_substr($title, 0, $
}
return $title;
} else {
return $title;
}
}
// END Shorten product titles

We have the exact snippet in all our other websites too but never got this bug. If you figure out why it caused it please do tell me! I recently found that the Woodmart Theme has that functionality integrated so there is no need for that snippet in this website.

Have a nice day.