Reply 356205 to: Mega menu images not compatible with lazy load

Avatar: Rose Tyler
Rose Tyler
Support staff
May 10, 2023 at 08:43

Hello, Fabio,

Thank you for your response.

1/ Recently we improved the “getter” functions for menu images ( https://prnt.sc/CKb1aQmn234P in xstore/framework/walkers.php) with wordpress default function called ‘wp_get_attachment_image’ → https://developer.wordpress.org/reference/functions/wp_get_attachment_image/

Could you, please, explain to us how should the image be taken or what function we should use then to make it correct lazyload with your plugin? As we see in their code they use a few filters for replacing/adding ‘lazyload’ class → https://prnt.sc/UMkgWVTlb3Z3 but how should it be done then? Also, maybe, it is a question related them to add one more filter for such cases, or in your case such menu images are simply load first without lazy because they are at the same top of each page?

2/ In a few words:
As we changed the function for getting image for menu items you should also replace srcset attribute for images on hover. Changes were made in your script file → XStore Child: custom-megamenu-script.js. More info about srcset → https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images

Kind Regards,
8theme team

Go To The Whole Conversation In Topic
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.