Minimal theme: How to limit product title to 2 lines?

Solved
thevista888
Explorer
63 0 21

I tried to limit the characters by using truncate, (found the code here in forum) it works fine but I need to keep the title at same level, it works on desktop but doesn't work on mobile. 
So its better to limit the product title to 2 lines, not limiting the characters.

I tried the codes in this topic, it didn't work.
I use minimal theme.
My store link: https://wiggleduck.com/ 

0 Likes

Hi @thevista888 ,

As I can see your title is lengthy so if you try for decrease the font size then it will not visible at mobile.

Right solution is keep one product in one row for mobile version. so that  title will be  in 2 lines.

Like this

oscprofessional_0-1632399205357.png

 

If helpful then please Like and Accept Solution. Free Website Review and advice for sale from Hire us
Shopify Conversion Experts | Shopify Private App | Custom Theme Development | Custom Modifications In To Shopify Theme | Shopify SEO | Digital Marketing | Site Speed Optimization | Performance Site Audit
For Quick Chat Whats app | Email: pallavi@oscprofessionals.com | Skype : oscprofessionals-87
0 Likes

This is an accepted solution.

@thevista888, do this to fix it in 20 seconds:

1. In your Shopify Admin go to: online store > themes > actions > edit code
2. Find Asset > theme.scss.liquid or theme.css and paste this at the bottom of the file:

p.grid-link__title {
      display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;  
  overflow: hidden;
}

 

diego_ezfy_0-1632401440880.png

 



Kind regards,
Diego

◦ Slideshow section not looking good or cutting off? Try the Slideshow (PRO) section. No apps required.
◦ Replace apps with copy/paste code snippets. Examples here.
◦ In need of coding help? I'm available for hire! ezfycode@gmail.com
0 Likes
thevista888
Explorer
63 0 21

@oscprofessional 

How did you do it? I don't see any differences between the original file. Sorry if I'm missing.

0 Likes
thevista888
Explorer
63 0 21

@diego_ezfy Thanks for your precious help. Problem solved.

0 Likes