Home Forums Theme Support Dokan How to make the product title fixed for 2 line height?

This topic is: resolved

Tagged: 

This topic contains 2 replies, has 2 voices, and was last updated by  Sk 5 years ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #20777

    mx
    Member
    Post count: 42

    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;
    }

    #20997

    Sk
    Moderator
    Post count: 371

    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. ๐Ÿ™‚

    #21001

    Sk
    Moderator
    Post count: 371

    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 3 posts - 1 through 3 (of 3 total)

The topic ‘How to make the product title fixed for 2 line height?’ is closed to new replies.