Lazy Load

Descripción

Lazy load images to improve page load times. Uses jQuery.sonar to only load an image when it’s visible in the viewport.

This plugin is an amalgamation of code written by the WordPress.com VIP team at Automattic, the TechCrunch 2011 Redesign team, and Jake Goldman (10up LLC).

Uses jQuery.sonar by Dave Artz (AOL).

No applicable screenshots

Instalación

  1. Upload the plugin to your plugins directory
  2. Activar el plugin a través del menú ‘Plugins’ en WordPress
  3. ¡Disfrútalo!

Preguntas frecuentes

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 1×1 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.

Reseñas

Super fast and light

Worked right away, no setup work needed. The plugin is less than 10KB, makes my gallery blog way faster, loads reverse up when using TOC anchors (big plus), keeps DOM elements as IMGs, and has a good display. Exceeded all expectations! This is my new go to plugin.

Semplice e efficace

Ho usato questo plugin un sacco di volte e non ho mai avuto dei problemi.

Per questo gli do 5 stelle e lo raccomando a tutti i miei clienti che hanno bisogno di una soluzione per il lazy loading delle immagini.

Parlo dello stesso plugin anche in questo articolo che spiega come migliorare le prestazioni di WordPress

Muito bom

Como equipe de programação da DevMedia utilizou a técnica de Lazy Load, com jQuery, para otimizar o tempo de carregamento da página por meio de requisições Ajax.

Simple. Works.

Install. Enable. Done.

Noticable page load time decrease on my image heavy blog (even though the images are hosted externally) with no visible downside.

Images are loaded just before they appear so the user never notices (unless they scroll straight to the bottom and even then it doesn’t take long for the images to catch up).

Great plugin. Thanks for sharing it.

Leer todas las 45 reseñas

Colaboradores y desarrolladores

“Lazy Load” es un software de código abierto. Las siguientes personas han colaborado con este plugin.

Colaboradores

“Lazy Load” se ha traducido a 3 idiomas: Ukrainian, Russian, Dutch. Gracias a los traductores por sus colaboraciones.

Traduce “Lazy Load” a tu idioma.

¿Interesado en el desarrollo?

Revisa el código o suscríbete al historial de desarrollo por RSS.

Registro de cambios

0.6.1

0.6

  • Filter to control when lazy loading is enabled

0.5

  • Fix lazyload_images_add_placeholders by adding missing return, props Kevin Smith
  • Lazy load avatars, props i8ramin
  • Don’t lazy load images in the Dashboard
  • Better compatibility with Jetpack Carousel

0.4

  • New helper function to lazy load non-post content
  • Prevent circular lazy-loading

0.3

  • Make LazyLoad a static class so that it’s easier to change its hooks
  • Hook in at a higher priority for content filters

0.2

  • Adds noscript tags to allow the image to show up in no-js contexts (including crawlers), props smub
  • Lazy Load post thumbnails, props ivancamilov

0.1

  • Initial working version