WordPress.org

Ready to get started?Download WordPress

Forums

Lazy Load
Remove lazyload in indexpage (3 posts)

  1. robertlundell
    Member
    Posted 1 year ago #

    Hi

    I would like to remove the lazyload function om my indexpage. This because it prevents the thumbnails to load until the user starts to scroll.

    So is this possible?

    Br

    robertlundell.com

    http://wordpress.org/extend/plugins/lazy-load/

  2. ironprogrammer
    Member
    Posted 1 year ago #

    It's a hack, but if the text "data-lazy-src"* exists in your post/page content, then the plugin will not perform its image replacement magic, thereby leaving images as-is.

    So you could, for instance, insert a comment into your post/page:
    <!-- data-lazy-src -->

    Or add an arbitrary attribute to an existing image or other element in your post/page source:
    <img src="my-image.png" alt="don't lazy load me" data-hack="data-lazy-src" />

    Note that this will NOT work if you simply stick the text in your theme's source files -- it needs to be part of the loop's content in order to be picked up by the appropriate WP filters.

    I used the latter option to prevent Lazy Load from messing with an image gallery (Meteor Slides + MaxImage 2).

    Hope this helps!
    Brian

    (*Line 40 of the plugin is where this check is performed. This is a total hack, so if you update the plugin, make sure to check that this condition still exists, and update as appropriate!)

  3. Mike
    Member
    Posted 6 months ago #

    Thanks for the work-around, but I can't get it to work in one situation. I have a page on which a certain number of photos load initially, then there's a "Load More" button which loads more photos. Those subsequent photos which are are called with the "Load More" button never load with Lazy Load activated, even if I include <!-- data-lazy-src --> in the page content. I'm not able to use the second method because these photos are pulled in via shortcode, not from within the code on the page.

    Is there any other way to disable Lazy Load on a given page?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic