WordPress.org

Plugin Directory

Changeset 567479


Ignore:
Timestamp:
07/04/12 17:56:53 (22 months ago)
Author:
batmoo
Message:

Readme updates with added usage docs

Location:
lazy-load
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lazy-load/tags/0.4/readme.txt

    r567473 r567479  
    2828== Frequently Asked Questions == 
    2929 
     30= How do I change the placeholder image = 
     31 
     32` 
     33add_filter( 'lazyload_images_placeholder_image', 'my_custom_lazyload_placeholder_image' ); 
     34function my_custom_lazyload_placeholder_image( $image ) { 
     35    return 'http://url/to/image'; 
     36} 
     37` 
     38 
    3039= How do I lazy load other images in my theme? = 
    3140 
    32 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. 
     41You can use the lazyload_images_add_placeholders helper function: 
    3342 
    34 The alternative, and this isn't too highly recommended, is to use output buffering: 
     43` 
     44if ( function_exists( 'lazyload_images_add_placeholders' ) ) 
     45    $content = lazyload_images_add_placeholders( $content ); 
     46` 
    3547 
    36 `ob_start( array( LazyLoad_Images, 'add_image_placeholders' ) );` 
     48Or, 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. 
     49 
     50You can also use output buffering, though this isn't recommended: 
     51 
     52` 
     53if ( function_exists( 'lazyload_images_add_placeholders' ) ) 
     54    ob_start( 'lazyload_images_add_placeholders' ); 
     55` 
    3756 
    3857This will lazy load <em>all</em> your images. 
  • lazy-load/trunk/readme.txt

    r567472 r567479  
    2828== Frequently Asked Questions == 
    2929 
     30= How do I change the placeholder image = 
     31 
     32` 
     33add_filter( 'lazyload_images_placeholder_image', 'my_custom_lazyload_placeholder_image' ); 
     34function my_custom_lazyload_placeholder_image( $image ) { 
     35    return 'http://url/to/image'; 
     36} 
     37` 
     38 
    3039= How do I lazy load other images in my theme? = 
    3140 
    32 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. 
     41You can use the lazyload_images_add_placeholders helper function: 
    3342 
    34 The alternative, and this isn't too highly recommended, is to use output buffering: 
     43` 
     44if ( function_exists( 'lazyload_images_add_placeholders' ) ) 
     45    $content = lazyload_images_add_placeholders( $content ); 
     46` 
    3547 
    36 `ob_start( array( LazyLoad_Images, 'add_image_placeholders' ) );` 
     48Or, 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. 
     49 
     50You can also use output buffering, though this isn't recommended: 
     51 
     52` 
     53if ( function_exists( 'lazyload_images_add_placeholders' ) ) 
     54    ob_start( 'lazyload_images_add_placeholders' ); 
     55` 
    3756 
    3857This will lazy load <em>all</em> your images. 
Note: See TracChangeset for help on using the changeset viewer.