Here is a little follow-up to this thread.
So in order to add a line break in Woocommerce Product Titles, I have added this code to the functions.php:
//ADD LINE BREAK add_filter( 'the_title', 'custom_the_title', 10, 2 ); function custom_the_title( $title, $post_id ) {
$post_type = get_post_field( 'post_type', $post_id, true ); if( $post_type == 'product' || $post_type == 'product_variation' )
$title = str_replace( '|', '<br/>', $title ); // we replace '|' by '<br>' return $title; }
...which works amazing on Product Category pages. However for some reason it does not when one of the product lists is imported as a widget on a static page (the Front Page of my shop). What could be the problem?
tag in there. what does the innerText or innerHTML look like when rendered as a widget? – This Guy Jan 05 '23 at 14:05