• Hi there, can I use this plugin with Static img tags I hard coded into the theme template? if so how? I’m assuming this only works with WordPress embedded images?

    Please let me know thanks!

    • This topic was modified 5 years, 9 months ago by devmoo.
    • This topic was modified 5 years, 9 months ago by devmoo.
Viewing 4 replies - 1 through 4 (of 4 total)
  • This would be helpful for me too! It’s working perfectly on my WordPress posts, but there are places where I’m using wp_get_attachment_image_src and echo-ing the output, so if there’s a class or something similar I could add to the that would be so great!

    Plugin Author WP Media

    (@wp_media)

    Hi,

    With the new version, Any image found in the page HTML should be lazyloaded, as it’s applying the replacement pretty late in the WordPress loading process.

    Thread Starter devmoo

    (@devmoo)

    @wp_media Hi, is there any way to tell if it’s working? Google page speed insights says “Please defer images/consider lazy loading” still with the plugin enabled. I think it might be because I’m usign Autoptimize and maybe it’s compressing and breaking the plugin. I see the lazy-load classes on the static HTML images, so I believe it’s attempting, but when I scroll the images seem already loaded (no loading animation, or popin), which I guess that’s good if it’s actually lazy loading just super fast?

    Thanks!

    Plugin Author WP Media

    (@wp_media)

    If you view the source code of the page, you should see that the src attribute has been replaced by an inline svg file, and that the data-lazy-src has been addded with the image URL.

    Keep in mind that images loaded via background-url in CSS, or via JS, can’t be lazyloaded.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Can I use this on Static Hardcoded Images?’ is closed to new replies.