How to make the product title fixed for 2 line height?

This topic contains 2 reply and 2 voices, and was last updated by Sk 10 years, 5 months ago
Viewing 2 Posts - 1 through 2 (of 2 total)
Author Posts
May 21, 2014 at 1:50 pm 20777
Sk Need help, thank you very much! http://wedevs.com/support/topic/how-to-set-a-character-limit-to-product-title-shown-on-dokan-site/ .home .product-sliders li h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; height: 60px; }
May 25, 2014 at 11:56 am 20997
Sk Sk

to solve this issue please follow the steps:
1. copy content-product.php file from wp-content/plugin/woocommerce/templates folder and paste it to wp-content/themes/dokan/woocommerce folder.

2. now open the file wp-content/themes/dokan/woocommerce/content-product.php.

3. replace line 54 ->

replace

<h3><?php the_title(); ?></h3>

by

<h3><?php echo wp_trim_words( get_the_title(), 4) ; ?></h3>

in this line 4 is, number of word you want to show in title. if your product title has more than 4 word it will show only 4 words in two line.

Thank you. 🙂

May 25, 2014 at 1:29 pm 21001
Sk Sk

you could also do it by css replace the following code on dokan/style.css at line 2919

replace

.woocommerce ul.products li.product h3, .woocommerce-page ul.products li.product h3 {
background: rgba(0, 0, 0, 0.5);
width: 100%;
padding: 5px 5px 5px 10px;
color: #fff;
margin: 0;
font-size: 1em;

by

.woocommerce ul.products li.product h3, .woocommerce-page ul.products li.product h3 {
background: rgba(0, 0, 0, 0.5);
width: 100%;
padding: 5px 5px 5px 10px;
color: #fff;
margin: 0;
font-size: 1em;
height: 37px;
overflow-y: hidden;

thank you. 🙂

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