• You MUST read the Babiato Rules before making your first post otherwise you may get permanent warning points or a permanent Ban.

    Our resources on Babiato Forum are CLEAN and SAFE. So you can use them for development and testing purposes. If your are on Windows and have an antivirus that alerts you about a possible infection: Know it's a false positive because all scripts are double checked by our experts. We advise you to add Babiato to trusted sites/sources or disable your antivirus momentarily while downloading a resource. "Enjoy your presence on Babiato"

[WP Rocket]How To Disable LazyLoad on Specific Images

you can do this either by using data-skip-lazy atribute or add skip-lazy to the header css class
 
you can either do this :


<img src="yourheaderlogo.jpg" class="skip-lazy" alt="" width="100" width="100" />

or

checkout the above link i posted to target a specific class
 
I tried it but can you please tell what changes I need to implement in code.
I don't want the image name "main-logo" to lazy load.
what theme are you using ??
just edit header.php find your img logo code change to this
<img src="your-logo-image.jpg" data-skip-lazy="" class="skip-lazy" alt="" />
 
This code breaks my layout.
if so, edit the header.php in wp-content/themes/generatepress/inc/structure
then follow the steps below
PHP:
//1. find header-image in header.php
//you will see code like this
$attr = apply_filters( 'generate_logo_attributes', array(
            'class' => 'header-image',
            'alt'    => esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ),
            'src'    => $logo_url,
            'title'    => esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ),
        ) );
   
//then replace the code above with the code below
$attr = apply_filters( 'generate_logo_attributes', array(
            'class' => 'skip-lazy header-image',
            'data-skip-lazy' => '',
            'alt'    => esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ),
            'src'    => $logo_url,
            'title'    => esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ),
        ) );
//save and refresh you homepage.

#result like this, i'm using generatepress theme without elementor plugin.
dd.png

If this doesn't work then you should Assigning class to Element in Elementor
-add skip-lazy class to logo element
 
Last edited:
AdBlock Detected

We get it, advertisements are annoying!

However in order to keep our huge array of resources free of charge we need to generate income from ads so to use the site you will need to turn off your adblocker.

If you'd like to have an ad free experience you can become a Babiato Lover by donating as little as $5 per month. Click on the Donate menu tab for more info.

I've Disabled AdBlock