How do I remove lazy loading on an image banner - Craft theme

How do I remove lazy loading on an image banner - Craft theme

stripedcircle
Visitor
3 0 1

Hi there - first time poster but long time user of this community board to resolve numerous issues 🙂

 

Can someone help me to set loading to eager on my Image Banner on my homepage, please?  It is currently set to lazy and this is impacting my LCP.  URL is https://stripedcircle.com if helpful!  I am currently using the Craft theme.

 

See below snip of Page Insights - but I can't see any code that sets loading to lazy in the image-banner.liquid file...

stripedcircle_0-1732816016736.png

Any advice gratefully received!

Many thanks, Tim.

Replies 4 (4)

Taknify
Shopify Partner
274 19 29

Why would you want to remove lazy loading? For users with slow internet speed, lazy loading actually helps because your image will load only if they are needed, instead of loading everything at once. But is it indeed true that removing lazy loading on "above the fold" content actually helps. 
I can help you out to check your theme code and remove that if you DM me your access.

Need to tweak your store for Black Friday? Simply, send me a message.

Ahmad31
Shopify Partner
224 21 37

 

  • Locate the File:

    • Go to Online Store > Themes > Actions > Edit Code.
    • Open image-banner.liquid (usually in the Sections folder).
  • Edit the <img> Tag:

    • Find the <img> tag, which might look like:
       

 

 

<img src="{{ image | img_url: '1600x' }}" alt="{{ image.alt | escape }}" loading="lazy">

 

 

Change it to :

 

 

<img src="{{ image | img_url: '1600x' }}" alt="{{ image.alt | escape }}" loading="eager" fetchpriority="high">

 

 

Save and Test:

 

Love my work? Buy Me A Coffee
Hire Me: Email me Or Chat on Whatsapp
If you found my solution helpful, please like and accept it. Your support is greatly appreciated!

Dan-From-Ryviu
Shopify Partner
11931 2340 2515

Hi @stripedcircle 

Please go to your Online Store > Themes > Edit code > open Image-banner.liquid file, under this line of code 

sizes: sizes,

Paste this code and save file 

preload,

Screenshot 2024-11-29 at 08.39.50.png

- Helpful? Like & Accept solution! - Support me? Buy me a coffee
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

stripedcircle
Visitor
3 0 1

Thanks Dan.  Unfortunately, that hasn't improved the load delay on the LCP element.  PageSpeed Insights is still showing that image as lazy loading and the load delay is 7,680ms (53% of LCP).  Any other thoughts?