Support

Account

Home Forums General Issues WordPress native Lazy Loading with ACF image field Reply To: WordPress native Lazy Loading with ACF image field

  • Enabling the lazy load may be confused you

    Sorry about that i will update the post next few days. Proper Title is add_theme_support for Lazy Load in fnctions.php is super easy and useful instead of using Plugin

    Lazy-Loading Images in WordPress Core

    The loading attribute currently supports two possible values:

    • eager, to load an image immediately on pageload
    • lazy, to load an image only when it becomes relevant for the viewport

    The implementation seeks to enable lazy-loading images by default, providing the loading attribute with value lazy on the following img tags:

    • Images in post content
    • Images in post excerpts
    • Images in comments
    • Images in text widget content
    • Individual images rendered via wp_get_attachment_image()
    • Avatar images rendered via get_avatar()

    Note that loading=”lazy” will only be added if the respective tag does not yet include a loading attribute. In other words, to prevent an image from being lazy-loaded, it is recommended to specify loading=”eager”.

    Source and more info in the Make WordPress

    This is used to add( support ) the loading=”” in the templates and to be able to play with it

    For example Lazy Load in WordPress since xxx Version is enabled by default. Mean everywhere lazy will be add to the images. I don’t need loading lazy for some specific parts of the template and the site. One of the most common errors by the Web Developers is to keep the lazy load enabled for all supported types in above the fold.

    add_theme_support( ‘lazy-load’ );

    means this will be supported as a tag for the custom template you build