Support » Theme: Online Shop » Sugestion regarding slider images

  • Hi, I have a suggestion: Adding width and height to the feature section slider to reduce Content Layout Shift and using medium size thumbnail on the vertical slider at right instead of full size.
    Kind Regards
    Francisco

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello @fmarconi ,

    How about optimizing the image before uploading it on WordPress in the proper size?

    Best Regards!

    Thread Starter Francisco

    (@fmarconi)

    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…

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Sugestion regarding slider images’ is closed to new replies.