How to implement lazy loading?

Sensei_Ryan
Shopify Partner
27 0 12

 

Hello,

 

I’ve been following some instruction I found online but am getting stuck on adding a class to image tag (step 3).

B0184B16-8489-4672-BB12-3796D1D01CD8.jpeg

Does anyone know how to locate the image tag for the theme?

 

 

website: follownoonestore.com

theme: Label

Replies 2 (2)
made4Uo
Shopify Partner
3787 710 1098

Hi @Sensei_Ryan,

 

You need to add loading="lazy" to your img tag. You only add this loading lazy to the image that you want to load later or not on the top of the browser when the browser loads 

<img src="image-link" alt="image-alt" loading="lazy">

 

Volunteering to assist you!  Likes and Accept as Solution  is highly appreciated.✌
Coffee fuels my dedication. If helpful, a small Coffee Tip would be greatly appreciated.
Need EXPERIENCED Shopify developer without breaking the bank?
Hire us at Made4Uo.com for quick replies.
Stay in control and maintain your security by avoiding unnecessary store access!
Cedcommerce
Shopify Expert
717 76 110

Hello @Sensei_Ryan ,

 

Finding each “img” tag is quite complex as we are using multiple sections or snippets in the Shopify theme. 

To get this issue resolved and implement Lazy loading properly first you need to write a custom code for selecting all “img” tags and then add this attribute loading="lazy" as shown in the below-provided code.

 

<img src="img_url" alt="img_alt" loading="lazy"/>

 

This will properly implement lazy loading. Let us know if you need any help with this.

 

Regards, 

CedCommerce

CedCommerce || Shopify Expert
- Let us know if our reply is helpful for you. Like it.
- Was your question answered? Mark it as an accepted solution.
- For further discussion contact: Email ID- apps@cedcommerce.com
- Whatsapp:- Join Here