sayheykevin
Member
- Mar 4, 2019
- 46
- 7
- 8
Can you please share me the css code.you can do this either by using data-skip-lazy atribute or add skip-lazy to the header css class
I tried it but can you please tell what changes I need to implement in code.
what theme are you using ??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.
I am using Generatepress theme+Elementorwhat 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.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="" />
if so, edit the header.php in wp-content/themes/generatepress/inc/structureThis code breaks my layout.
//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.