• Resolved sharmaabhi

    (@sharmaabhi)


    Hello,

    I want to show original image for products instead of thumbnails on shop page.
    Which template file do I need to change.
    I was able to do so for single product by passing “full” parameter to “get_the_post_thumbnail()” function.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Could you clarify what you mean by original image?

    Thread Starter sharmaabhi

    (@sharmaabhi)

    By original image, I mean the image that I uploaded for product into the media.
    As WordPress generate thumbnails according to the sizes we give in Settings -> Media
    Woocommerce showing that thumbnail for every product on products(Shop) page.
    I want to show that original image not resized one.

    Plugin Support Ryan Ray, a11n

    (@ryanr14)

    Hi @sharmaabhi,

    This is likely down to theme support, there are image sizes a theme can register for the three different images WooCommerce needs or wants to use.

    To use the original uploaded image you’ll need to modify your theme, and maybe WooCommerce, and tell it to use the full-size image, something like the_post_thumbnail('full'); in place of the product image.

    It’s not recommended as the original image isn’t normally shown or displayed anywhere in its full-size glory. It helps speed up your site and save bandwidth to generate the appropriately sized images and use those rather than the original.

    Thread Starter sharmaabhi

    (@sharmaabhi)

    Actually some of the products have ‘gif’ image instead of png or jpg. So, for gif files wordpress only regenerate thumbnail of the first frame of the gif file.

    Where do I put this the_post_thumbnail('full');. I can’t find template file.

    Jesse Pearson (a11n)

    (@jessepearson)

    Automattic Happiness Engineer

    @sharmaabhi You will need to use a filter to change the size of the images in the shop view. The answer given on this thread will work with some modifications:
    https://wordpress.stackexchange.com/questions/287488/how-to-change-the-catalog-product-image-size-by-product-id/287489

    You can remove just about everything in the function itself and just put return 'full';, which should do what you’d like.

    The filter would need to be placed in your functions.php file or added through a code snippets plugin.

    Thread Starter sharmaabhi

    (@sharmaabhi)

    Thanks @jesse
    I’ll check it.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Show original image rather than thumbnail for product on shop page’ is closed to new replies.