Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1259503

    Hi, I’m using wp-rocket and I need to disable lazyload on the preview image of my pages. To do this I need to add the data-skip-lazy attribute to the IMG HTML tag. Like <img src=”my-image.jpg” data-skip-lazy=””.

    But where do I find this on the enfold template?

    #1260885

    Hey Rafael,

    Thank you for the update.

    Are you using the default editor for the pages, or the Advance Layout Builder (ALB)? If you are using the default editor, you might have to modify the includes > loop-page.php file and change this line of code..

    $thumb = get_the_post_thumbnail( get_the_ID(), $avia_config['size'] );
    
    					if( $thumb ) 
    					{
    						echo "
    <div class='page-thumb'>{$thumb}</div>
    ";
    					}
    

    Replace the get_the_post_thumbnail function with the wp_get_attachment_image_src to get the URL of the featured image and define your own markup with the data-skip-lazy attribute.

    // https://developer.wordpress.org/reference/functions/wp_get_attachment_image_src/

    Best regards,
    Ismael

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.