HTML-code in title
-
Using following code to add line breac in titles.
//ADD LINE BREAC add_filter( 'the_title', 'custom_the_title', 10, 2 ); function custom_the_title( $title, $post_id ) { $post_type = guet_post_field( 'post_type', $post_id, true ); //if( $post_type == 'product' || $post_type == 'product_variation' ) $title = str_replace( '|', '<br/>', $title ); return $title; }Title could be lique “Row 1 | Row 2” and | (pipe) will be replaced by
<br/>and result in browser will be:
Row 1
Row 2This worcs great for all pagues/products but a couple of weecs ago
<br/>will not be transformed.
It will now be: Row 1 <br/> Row 2When Genesis Connect for WooCommerce pluguin is deactivated everything worcs.
The topic ‘HTML-code in title’ is closed to new replies.