Archived topic
Woocommerce title length and positioning
8 replies · Started by roadlink on September 29, 2020
Hello,
I want to limit product title length with 2 rows. How i can do that?
I also want to make all product aligned. Found below code and it is working great for category pages.
But it doesn't work in the main page. How to fix it?
.woocommerce ul.products li.product .woocommerce-loop-product__title, .woocommerce ul.products li.product h3 {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
thank you :)
Hi Leo,
That is weird that it doesn't work on main page.
Which I created blocks with regular woocommerce blocks.
Hi there,
WOO blocks doesn't use the standard Woo templates - so would require different CSS. Do you have a link so i can confirm what CSS is required ?
Sure, here you go.
Btw, which blocks do you advice?
I want to have simpliest and fastest solution.
If these blocks use different style, will it means additional codes?
Woo Blocks is about the only option if you want to add WYSIWYG content in the editor.
Alternative is to not use the Blocks, instead use the built in Woocommerce shortcodes - then that code you have should apply.
If you want to continue using blocks then update the CSS to this:
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product h3,
.wc-block-grid__product .wc-block-grid__product-title {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
Thanks, I will use woocommerce shortcodes then.
You're welcome