• Resolved azadbakhsh

    (@azadbakhsh)


    Hello, I tried to remove to limit of the Short description on the archive page in the list view. I searched and found below code:

    add_filter(‘woocommerce_short_description’,’limit_short_descr’);

    function limit_short_descr($description){
    return (strlen($description) > 30) ? substr($description, 0 , 30) : $description;
    }

    But the Problem is, when I use the up code, the Archive description is removed also, but I want to keep it. Please help me. Thanks

    function limit_short_descr($description){
    return (strlen($description) > 30) ? substr($description, 0 , 30) : $description;
    }

    • This topic was modified 1 year, 8 months ago by azadbakhsh.
    • This topic was modified 1 year, 8 months ago by azadbakhsh.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Roxy

    (@roxannestoltz)

    Hi @azadbakhsh ,

    Thanks for reaching out!

    I understand that you are using the above custom code to limit the Product short description on the archive page, however this is removing the Product description, too, is this correct?

    To have a better understanding of what you are seeing on your end, please can you share a screenshot of the “Product short description’, as well as the “Product description” on your site, before and after applying the custom code above.

    Snipboard.io can be used for easily sharing screenshots – please follow the instructions on that page, then paste the URL in this thread.

    Cheers!

    Thread Starter azadbakhsh

    (@azadbakhsh)

    Hello,

    Please check the below photo:

    https://s2.uupload.ir/files/short_description_c3is.jpg

    I want to completely remove the Products Short description and function on the archive pages.

    I used the code on the previous Topic and set limitations on 0, but the Category Description was removed too. 

    Please help me to completely remove the Products Short description and function on the archive pages. Thank you.

    Page address is:

    https://shopipersia.com/category/educational-software/

    Roxy

    (@roxannestoltz)

    Hi @azadbakhsh ,

    Thanks for providing clarity.

    From what I understand, you would like to completely remove the Product short description from being displayed on the archive page without affecting the Category description, is this correct?

    You can add the following CSS to Appearance → Customize → Additional CSS, and see if this works for you:

    .archive .woocommerce-product-details__short-description {
    display:none !important
    }

    The outcome of the above CSS is this:

    Just to add – this CSS will not remove the Product short description from Single product pages, this will remain visible.

    If the results above are still not what you are looking to achieve, please share screenshots highlighting exactly what you would like to remove, so that we can assist you more effectively.

    Cheers!

    Thread Starter azadbakhsh

    (@azadbakhsh)

    Hello,
    Thank you for your reply, but prefer to do it by placing a code on function?file not by CSS. Because with this method that you introduced, only the visitors can’t see the short description, but crawlers still can crawl the short description. I want to completely remove them from source code.

    Hi @azadbakhsh

    Thanks for providing further information about your end goal here.

    I understand that you would like the product’s short description to be hidden using a custom code to be added to your functions.php, correct?

    This is a fairly complex development topic that would require customization to do it. Since custom coding is outside our scope of support, I am leaving this thread open for a bit to see if anyone can chime in to help you out.

    For questions related to development and custom coding, your best bet is to ask on any of these channels for support. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, too.

    Hope this helps!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Limit short description on archive page’ is closed to new replies.