- This topic has 14 replies, 2 voices, and was last updated 5 years, 6 months ago by
David.
-
AuthorPosts
-
October 4, 2020 at 3:52 am #1471374
Escobar
Is there a way to limit by words or by characters the description of the woocommerce categories on the home page?
When setting showing a short description on the home page for articles is fine, but for categories it shows the full description and is sometimes too long.website is: https://herramientasbazarot.com
October 4, 2020 at 6:23 am #1471514David
StaffCustomer SupportHi there,
you could limit the number of lines that are displayed in Category archive short descriptions with this CSS:
body:not(.single-product) .product-category .woocommerce-product-details__short-description { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }October 4, 2020 at 8:49 am #1471779Escobar
Unfortunately it seems that it does not work in the home page which is where I need it
October 4, 2020 at 9:14 am #1471829David
StaffCustomer SupportDo you want it just applied to the H2 in the description?
If so try this:body.home .product-category .woocommerce-product-details__short-description h2 { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }October 4, 2020 at 9:44 am #1471879Escobar
I have cleared the cache and inserted the css but nothing
October 4, 2020 at 9:45 am #1471886David
StaffCustomer SupportChange this:
-webkit-line-clamp: 2;to-webkit-line-clamp: 1;It will change the number of lines from 2 to 1.
October 4, 2020 at 10:16 am #1471929Escobar
Now it seems is working…but not in https://www.mivestuariolaboral.com. I dont know why?
Would there be some way to show only the text in h2? that would be enough
October 4, 2020 at 10:55 am #1471975David
StaffCustomer SupportTry this CSS to remove all summary content aside from the H2:
body.home .product-category .woocommerce-product-details__short-description > *:not(h2) { display: none; }October 4, 2020 at 11:02 am #1471993Escobar
You’re great!!!
The only detail is that what is in h3 continues to appear, that is, if instead of h3 it is a normal paragraph it is hidden, otherwise not.
See here please: https://www.mivestuariolaboral.com
October 4, 2020 at 11:08 am #1472002Escobar
NO, I was wrong, what happens is that I have to circle the h3, h4 … with <p style = “text-align…
If I do that with the rest of the text (h3. H4 …) and shortcodes that I have inserted, it works perfectly.October 5, 2020 at 12:08 am #1472462David
StaffCustomer SupportIs that working correctly now ?
October 5, 2020 at 5:09 am #1472847Escobar
If I enclose the text or shortcode in the <p> tags it works perfectly.
You are great !!! Thank you very much.October 5, 2020 at 5:26 am #1472876David
StaffCustomer SupportGlad to hear that
October 13, 2020 at 3:51 am #1486371Escobar
Please, How can i do the same but in category and subcategories pages?
October 13, 2020 at 6:58 am #1486678David
StaffCustomer SupportTry adding this CSS :
.archive .woocommerce-product-details__short-description { display: none; } -
AuthorPosts
- You must be logged in to reply to this topic.