Archived topic
Lazy loading tips for GeneratePress?
7 replies · Started by Henry on November 4, 2020
I have to build a page that will have about 50 images, needless to say, I'd prefer some way to make the images load as the page is scrolled down.
Any tips, advice - plugin - on how to do this?
Thanks
Hi there,
are you using Autoptimize on your site? as it has Lazy loading options in it settings.
You will also find may of the other cache/optimization plugins eg. WP Rocket provide this.
Thanks David.
Interestingly though, I note that if I view the source code there is a class called "lazy"
<img loading="lazy" width="300" height="169" src="/ etc etc ></figure>
What is this img class "lazy"?
Thanks
In WP 5.5 they introduced native browser lazy loading. Which is great but not all browsers support eg. Safari and IE. More info on that here:
https://web.dev/browser-level-image-lazy-loading/
If you know your user base is 99% Chrome - then you can just let WP and the browser do its thing. If you want wider browser compatibility then you will need to use a lazy loader plugin.
Thanks, David - that's great news; and great knowledge you have! Appreciate it.
You're welcome!
There is a Google native Lazy Loading plugin in the Wordpress plugin store:
https://wordpress.org/plugins/native-lazyload/
FYI: Its now built into WP since version 5.5:
https://make.wordpress.org/core/2020/07/14/lazy-loading-images-in-5-5/
But like that plugin is not supported on all browsers. Chrome, and FF nightly support it. But not Safari, and definitely not IE.