HTML-code in title
-
Using following code to add line break in titles.
//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 ); return $title; }
Title could be like “Row 1 | Row 2” and | (pipe) will be replaced by
<br/>
and result in browser will be:
Row 1
Row 2This works great for all pages/products but a couple of weeks ago
<br/>
will not be transformed.
It will now be: Row 1 <br/> Row 2When Genesis Connect for WooCommerce plugin is deactivated everything works.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘HTML-code in title’ is closed to new replies.