WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Lazy Load

Lazy load images to improve page load times and server bandwidth. Images are loaded only when visible to the user.

How do I change the placeholder image

add_filter( 'lazyload_images_placeholder_image', 'my_custom_lazyload_placeholder_image' );
function my_custom_lazyload_placeholder_image( $image ) {
    return 'http://url/to/image';
}

How do I lazy load other images in my theme?

You can use the lazyload_images_add_placeholders helper function:

if ( function_exists( 'lazyload_images_add_placeholders' ) )
    $content = lazyload_images_add_placeholders( $content );

Or, you can add an attribute called "data-lazy-src" with the source of the image URL and set the actual image URL to a transparent 1x1 pixel.

You can also use output buffering, though this isn't recommended:

if ( function_exists( 'lazyload_images_add_placeholders' ) )
    ob_start( 'lazyload_images_add_placeholders' );

This will lazy load all your images.

Requires: 3.2 or higher
Compatible up to: 3.4.2
Last Updated: 2012-9-4
Downloads: 84,265

Ratings

4 stars
4.5 out of 5 stars

Support

0 of 2 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

1 person says it works.
0 people say it's broken.

86,7,6 0,1,0
100,5,5 100,1,1
100,1,1 100,1,1 50,8,4
67,3,2
50,2,1 100,3,3
71,7,5 100,2,2
50,6,3
100,2,2
71,7,5
0,1,0
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1