WooCommerce + Jetpack: Exclude Image From “Lazy Load”
If you don’t use an “Image Lazy Load” plugin, it’s time you install one. And if you happen to pick Jetpack’s free Lazy Load module, you probably did the right thing.
However, since I installed Jetpack Lazy Load, I noticed a little “jump” in my Storefront theme header section, where in fact there is an image – my Business Bloomer logo. The same might apply to any WooCommerce image: a category thumbnail, a single product featured image, a cart icon in the header, a homepage hero image, and so on.
Thankfully Jetpack has a useful “filter” you can tap into in order to exclude image classes from lazy loading (yes, I found this out today, it’s not that I know everything!). So, here’s the fix. Enjoy 🙂
PHP Snippet: Exclude Image e.g. Logo From Jetpack Lazy Load
This code still works, unless you report otherwise. To exclude conflicts, temporarily switch to the Storefront theme, disable all plugins except WooCommerce, and test the snippet again: WooCommerce troubleshooting 101
Storefront Theme Visual Hook Guide Here’s a visual hook guide for Storefront Theme by WooCommerce. This visual guide belongs to my “Visual Hook Guide Series“, that I’ve put together so that you can find WooCommerce hooks quickly and easily by seeing their actual locations. Also, you can copy & paste in seconds and speed up your customization time. Let me […]
WooCommerce: Hide “Showing x-y of z results” @ Shop Page This is quite an annoying thing in WooCommerce when you have just a few products. Besides, if you only have 1 product in a given category, the notice “Showing the Single Result” will appear on top of the category page. So, how do we remove the whole “Showing 1–15 of 178 results” element from the […]
WooCommerce: Add an Icon to the Add to Cart Buttons Ecommerce is all about user experience, and making it easier for people to add to cart and checkout smoothly. Reducing the number of checkout fields is a great idea for example – as well as graphically communicating your number 1 objective: “please add to cart now!”. So, how do you add an icon (or an […]
WooCommerce + Storefront Theme: Hide Homepage Title The Storefront theme displays the homepage H1 title by default, no matter if you use the “Default” or the “Homepage” page template. Of course, you could do it via CSS, with a simple “display:none”. Even better, you could completely avoid loading the homepage title by using PHP (SEOs out there: better not to load an […]
WooCommerce: 10 Crucial Issues That Should Be Fixed Right Now I just spent the last 3 days in Porto with another 2,300 WordPressers at the first in-person WordCamp Europe since Berlin 2019. I had a blast, held a nice (yet long) workshop, spoke to many, but got tired too soon. Later on, I realized that that tiredness was something more serious – in fact I […]
Business Bloomer Founder
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. Follow @rmelogli