• How can I set woocommerce prodcut catalog so that the product title text has always 3 or 4 lines? So that the products would align more perfectly?

    And how to adjust the size of read more button to same size as add to cart button. so they would be same size.

    Thank you

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi there!!

    You can reduce the font size for the product title to 13px it will make all the titles in the same line and also it will align both buttons of add to cart and read more in the same line.

    .woocommerce ul.products li.product .woocommerce-loop-product__title, .woocommerce-page ul.products li.product .woocommerce-loop-product__title, .wc-block-grid .wc-block-grid__products .wc-block-grid__product .wc-block-grid__product-title {
        font-size: 13px;
        font-family: 'Lato',sans-serif;
    }

    Try to add the above CSS into your customizer>> additional CSS.

    Best Regards !!

    Thread Starter boardhouse

    (@boardhouse)

    Hello

    It is not enough because still some product title name is so long that it takes 2 lines so it will mess up the alignment. I rather would have emply lines between name and price so all would align correctyl.

    Also to get the add to cart and read more buttons are not same size. how to do that?

    best regards

    Hi there

    For the product title please add the following code into your function.php files

    And please just replace number 2 as much as how many character you want on your title.

    add_filter( 'the_title', 'shorten_woo_product_title', 10, 2 );
    function shorten_woo_product_title( $title, $id ) {
        if ( ! is_singular( array( 'product' ) ) && get_post_type( $id ) === 'product' && strlen( $title ) > 2 ) {
            return substr( $title, 0, 2) . '…'; // change last number to the number of characters you want
        } else {
            return $title;
        }
    }

    Hi @boardhouse, sorry for the delay.

    Please try the following CSS to align the Add to Cart buttons evenly on the same level.

    I hope it will help.

    Kind regards,
    Herman ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Astra woocommerce shop product title text 3 lines’ is closed to new replies.