• Hi,
    Is there any way to disable default lazyload for the astra featured image without any plugin? The new default lazyloading system lazyloads the featured image that is caought by web vitals and pagespeed insight. As a result, the LCP fails. Would you tell me how can I get rid of this problem in astra theme without any plugin?

    Thank you, regards.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi @yusufmahtab,

    Astra doesn’t have such LazyLoad feature. It is probably coming from a plugin installed on your site. Or it is the default WordPress LazyLoad?

    I hope it will help.

    Kind regards,
    Herman ??

    Thread Starter yusufmahtab

    (@yusufmahtab)

    I know that astra doesn’t have any lazyload function. I think you did get my question.
    I wanted to know what is the exact query by what I can disable the WordPress’s default lazyload for the featured image only.

    NB: You don’t need any plugin now to lazyload your media in WordPress since the latest version of WordPress has a default lazyloading option.

    -Thanks.

    If you have JetPack installed, you may have it enabled there. Under performance.

    Hi @yusufmahtab,

    Try add add_filter( 'wp_lazy_loading_enabled', '__return_false' ); to your child theme’s functions.php file and see if it works.

    I hope it will help.

    Kind regards,
    Herman ??

    I am having the same issue. why it’s impossible to turn off lazy loading only for the featured image?

    I’ve tried
    add_filter( 'wp_lazy_loading_enabled', '__return_false' );

    I’ve also tried with

    /* Remove lazy load first image */
    function add_responsive_class($content){
    if ( is_single() || is_page() || is_front_page() || is_home() ) {
    $content = mb_convert_encoding($content, 'HTML-ENTITIES', "UTF-8");
    $document = new DOMDocument();
    libxml_use_internal_errors(true);
    $document->loadHTML(utf8_decode($content));
    $imgs = $document->getElementsByTagName('img');
    $img = $imgs[0];
    if ($imgs[0] == 1) { // Check first if it is the first image
    $img->removeAttribute( 'loading' );
    $html = $document->saveHTML();
    return $html;
    }
    else {
    return $content;
    }
    }
    else {
    return $content;
    }
    }
    add_filter ('the_content', 'add_responsive_class');

    but these work on all images EXCEPT for the FEATURED image!

    very frustrating

    Hi @ropezg,

    Do you think it is related to what has been discussed in this thread?

    Looking forward to hearing from you.

    Kind regards,
    Herman ??

    Hi Herman,

    there is no solution provided in the thread. As I wrote I already tried all of them. I don’t use Jetpack and I tried the recommended wordpress filter to disable lazy load but it doesn’t work on the featured image.
    My assumption is it’s how the theme is coded and the theme should be changed

    best regards
    P.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Disable LazyLoad for Featured Image’ is closed to new replies.