0

I am using Add a line break in Woocommerce Product Titles answer code, but i would like to change the font size for the 2nd line and to change the character from "|" to "-" but when i change it the code not working.

LoicTheAztec
  • 229,944
  • 23
  • 356
  • 399
  • To change the font size you have to change the css, `$title = str_replace( '-', '
    ', $title );` this statement will only replace explicitly given
    in the variable `$title`. Can help you further if you could post the html and css part as well.
    – Paul Baiju Sep 28 '20 at 10:58
  • Thank i actully took the break title code from you , the point im trying to replace the character from "|" to "-" i tried mayne character its all working except this character which i want it - i tried $title = str_replace( '-', '
    ', $title ); but nothing change
    – Mohd Aljaraba Sep 28 '20 at 14:18
  • this is whit random character https://prnt.sc/upd6wf its working perfectly https://prnt.sc/upd7qh but as i explen before with - not working i used this code add_filter( 'the_title', 'custom_product_title', 10, 2 ); function custom_product_title( $title, $post_id ){ $post_type = get_post_field( 'post_type', $post_id, true ); if( in_array( $post_type, array( 'product', 'product_variation') ) ) { $title = str_replace( '^', '
    ', $title ); // we replace "^" by "
    " } return $title; }
    – Mohd Aljaraba Sep 28 '20 at 14:41

0 Answers0