• Resolved themefour

    (@themefour)


    Hello. Some images of lazyload are loaded. But some don’t. How do I add lazyload to static images as well?

    my code:
    <img class="lazyloaded" src="<?php echo $option_meta; ?>" alt="<?php the_title_attribute(); ?>"></a>

    I’m using Metabax. With this code, image loading, the lzy is not loaded!

    plz help me.

    • This topic was modified 6 years, 8 months ago by themefour.
    • This topic was modified 6 years, 8 months ago by themefour.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Florian Brinkmann

    (@florianbrinkmann)

    Hi,

    you can pass markup to the plugin like that:

    if ( isset( $lazy_loader ) && $lazy_loader instanceof FlorianBrinkmann\LazyLoadResponsiveImages\Plugin ) {
        echo $lazy_loader->filter_markup( $the_markup );
    }
    

    The result is the modified markup.

    Do not add the lazyloaded class to that markup, just the src and, if you want, alt, et cetera.

    Best,
    Florian

    Thread Starter themefour

    (@themefour)

    tnx. but not work.

    <img src="<?php echo $option_meta; ?>" alt="<?php the_title_attribute(); ?>"></a>

    The image loads when viewing the page. But it is not loaded with the Lazyload method.

    • This reply was modified 6 years, 8 months ago by themefour.
    Thread Starter themefour

    (@themefour)

    I use the following plugin for Metabox.

    https://ww.wp.xz.cn/plugins/meta-box/

    Plugin Author Florian Brinkmann

    (@florianbrinkmann)

    Hi,

    how does the code look like where you pass the image to Lazy Loader? Do you get any error messages? Can you post a link to the site?

    Florian

    Plugin Author Florian Brinkmann

    (@florianbrinkmann)

    Marking that as resolved because there was no feedback to last reply.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘add class for lazyload’ is closed to new replies.