Hello @fmarconi ,
How about optimizing the image before uploading it on WordPress in the proper size?
Best Regards!
Hi @codersantosh sorry, it is not about the image itself.
I found that Google complains about front page content layout shift because slider do not declare width and height on slider-sections.php line 146:
echo '<img src="'.esc_url( $image_url[0] ).'"/>';
I did this to solve:
echo '<img src="'.esc_url( $image_url[0] ).'" width="655" height="418"/>';
Also realized that the product image is shown in full size on the right side slider because explicit parameter on this line 280:
$image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );
I don’t want a small full image to solve this because it is the product image used in single product page, so I changed it:
$image_url = wp_get_attachment_image_src(get_post_thumbnail_id(), 'medium' );
Maybe I’m missing what do you mean optimizing the images…