Hi, I want to make a line break where I want on a product title, I tried CSS code, but it didn’t work, it worked when I tried in the developer tool. So is there another way to make 2 lines of the product title in the archives page and a single product page?
here is code that I tried already
.product_title entry-title wd-entities-title{
padding right:70px;
}
——————————–
.product_title{
padding right:70px;
}
——————————-
add_filter( ‘the_title’, ‘custom_the_title’, 100, 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( ‘ | ‘, ‘
‘, $title );
}
return $title;
}
add_filter( ‘woocommerce_cart_item_name’, ‘iconic_cart_item_title’, 100, 3 );
function iconic_cart_item_title( $title, $cart_item, $cart_item_key ) {
return custom_the_title( $title, $cart_item[‘product_id’] );
}
-> this one makes it 2 lines only on a single product page, and shows’ |’ on the archive page.