WooWeekly #274: Hide Widgets (Plus: Truncate Description)

How are you?

It’s a weird Wednesday here in Sicily, both my soon-to-be father-in-law and my mom are not feeling great so I’m concerned – hope the situation can get better. I think I’ll fly to Rome so I can look after my mom, so I might skip next week’s issue if I have no time. Thanks for your patience đŸ™‚

Anyhow, welcome back to our WooCommerce Weekly appointment – here comes a series of WooCommerce articles put together by yours truly so that you can learn something new – you’ll also find a list of previous articles in case you missed any.

New: WooCommerce Tips & Tutorials

WooCommerce: Conditionally Hide Widgets

You could use a popular plugin called Widget Logic, or instead you could keep it simple with a few lines of PHP. Here’s a snippet for you in case you need to conditionally hide a certain sidebar widget given a condition e.g. if you’re on the Cart page. Of course, you can use any of the available WooCommerce conditional tags and make this more complex, but in this example we’ll keep it simple and check if we’re looking at the Cart page (thanks to the is_cart() conditional). Enjoy: https://businessbloomer.com/woocommerce-conditionally-hide-widgets

WooCommerce: Truncate Short Description With “Read More” Toggle

You can apply this simple jQuery snippet to any piece of WooCommerce content. In this example we’ll see how to truncate the WooCommerce single product short description and place a “read more” link to reveal the hidden content… however you can also apply this to the long description, a custom product tab, the product gallery, and whatever can be truncated. Enjoy: https://businessbloomer.com/woocommerce-truncate-short-description-with-read-more-toggle

Author

  • Rodolfo Melogli

    Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza.

    View all posts

Proudly supported by

Join them?