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?
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