Use fixed size images in product archive

This topic has 6 replies, 3 voices, and was last updated 3 months, 2 weeks ago ago by Luca Rossi

  • Avatar: Lili336
    Lili336
    Participant
    July 30, 2024 at 14:51

    Hello,

    I uploaded images in the following format: X-400×300.jpg in wp-content/uploads/2024/07
    X being a variable corresponding to the identifier of the original image.

    Example:
    123.jpg is the original image
    I added 123-400×300.jpg in wp-content/uploads/2024/07

    In product archive, my product images are displayed either:
    – 123.jpg
    or
    – 123-300×300.jpg

    How to impose the -400×300 format on all my products in product archive (all my images in 400×300 format have been uploaded)

    Thanks in advance 🙂

    5 Answers
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    July 30, 2024 at 15:21

    Hello Lili336,

    Thank you for reaching out to us with your query regarding image formatting in your product archive.

    Please read these articles https://www.8theme.com/documentation/xstore/woocommerce/product-images/ https://docs.woocommerce.com/document/fixing-blurry-product-images/
    Edit Appearance > Customize > WooCommerce > Product Images > Thumbnails Size, and regenerate thumbnails to apply changes.

    Contact support of WooCommerce to get further assistance because image settings are independent of the theme – https://wordpress.org/support/plugin/woocommerce/

    We hope this information is helpful.

    Best Regards,
    8Theme’s Team

    Avatar: Lili336
    Lili336
    Participant
    July 30, 2024 at 15:33

    Could you rather give me please a hack so that I can in function.php of the child theme force so that the image of the products in product archive ends with -400×300.jpg rather than having to regenerate tens of thousands of photos that I already have on my server.
    Thanks in advance

    Avatar: Justin
    Luca Rossi
    Support staff
    July 30, 2024 at 15:39

    Hi @Lili336,

    Could you please provide us with your website URL so we can take a closer look?

    Thank you!

    Avatar: Lili336
    Lili336
    Participant
    July 30, 2024 at 15:44

    The site is under maintenance, only I can access it at the moment, wouldn’t you have a simple solution to force in product archive that my images must be the one ending with -400×300.jpg

    A big thank you for your understanding

    Avatar: Justin
    Luca Rossi
    Support staff
    July 31, 2024 at 06:27

    Hi @Lili336,

    You can try with this custom CSS codes:

    
    .etheme-product-grid-image img {
        object-fit: cover;
        aspect-ratio: 1/1;
        width: 100%;
        height: auto;
    }
    

    If it doesn’t help, we would appreciate it if you could provide us with access to your WordPress Admin panel. Please share the following credentials:

    – WordPress Admin Username
    – WordPress Admin Password
    – WordPress Login URL

    Your cooperation is greatly appreciated, and we look forward to your prompt response.

    Best Regards,
    8Theme’s Team

  • Viewing 6 results - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.Log in/Sign up

8theme customization service
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.