Site logo

[Support request] Category descripction woocomerce homepage

Home Forums Support [Support request] Category descripction woocomerce homepage

Home Forums Support Category descripction woocomerce homepage

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #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

    #1471514
    David
    Staff
    Customer Support

    Hi 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;
    }
    #1471779
    Escobar

    Unfortunately it seems that it does not work in the home page which is where I need it

    #1471829
    David
    Staff
    Customer Support

    Do 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;
    }
    #1471879
    Escobar

    I have cleared the cache and inserted the css but nothing

    #1471886
    David
    Staff
    Customer Support

    Change this:

    -webkit-line-clamp: 2; to -webkit-line-clamp: 1;

    It will change the number of lines from 2 to 1.

    #1471929
    Escobar

    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

    #1471975
    David
    Staff
    Customer Support

    Try this CSS to remove all summary content aside from the H2:

    body.home .product-category .woocommerce-product-details__short-description > *:not(h2) {
        display: none;
    }
    #1471993
    Escobar

    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

    #1472002
    Escobar

    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.

    #1472462
    David
    Staff
    Customer Support

    Is that working correctly now ?

    #1472847
    Escobar

    If I enclose the text or shortcode in the <p> tags it works perfectly.
    You are great !!! Thank you very much.

    #1472876
    David
    Staff
    Customer Support

    Glad to hear that

    #1486371
    Escobar

    Please, How can i do the same but in category and subcategories pages?

    #1486678
    David
    Staff
    Customer Support

    Try adding this CSS :

    .archive .woocommerce-product-details__short-description {
        display: none;
    }
Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.