Lazy Load images, videos, iframes and more using Lazy Load XT.
Lazy load images, YouTube and Vimeo videos, and iframes using Lazy Load XT.
Lazy Load XT is the fastest, lightest, fully customizable lazy load plugin in the WordPress Plugin Directory.
This plugin works by loading the Lazy Load XT script and replacing the src
attributes with data-src
when the content of a post or page is loaded on the front end of a WordPress site.
or
lazy-load-xt
folder to the /wp-content/plugins/
directoryLazy Load XT filters images added to the page using the_content
, post_thumbnail_html
, widget_text
and get_avatar
. If your images are added using another function (wp_get_attachment_image
for example), Lazy Load XT does not filter them. However, as of v0.4, you can filter the HTML yourself by passing it to get_lazyloadxt_html
.
For example, if a theme has:
echo wp_get_attachment_image($id);
Changing it to the following would lazy load the image:
echo get_lazyloadxt_html( wp_get_attachment_image($id) );
get_lazyloadxt_html()
to let users pass HTML to be filteredwp_enqueue_scripts()
src
with data-src
in the_content()