Home Forums WoodMart support forum woocommerce product title in 2 line

woocommerce product title in 2 line

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #376064

    Joy
    Participant

    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.

    #376085

    Artem Temos
    Keymaster

    Hello,

    We would be happy to help but this code seems to be written for a single product only and it needs to be customized to make it work on the archive page. Sorry, but such customizations are out of our theme support scope.

    Kind Regards

Viewing 2 posts - 1 through 2 (of 2 total)