• 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 2

    This 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 2

    When Genesis Connect for WooCommerce plugin is deactivated everything works.

Viewing 1 replies (of 1 total)
  • Hi there,

    We do not see anything wrong with the code you shared and are not able to reproduce the error with Genesis Sample and Genesis Connect 1.1.1.

    Has the plugin been modified, or did you change anything else a couple of weeks ago when you started having this issue?

Viewing 1 replies (of 1 total)
  • The topic ‘HTML-code in title’ is closed to new replies.