• Resolved blue

    (@life2)


    Hi,

    Is there a way to change the product thumbnail size only in widgets (specifically ‘products’ widget)?

    I tried copying the file ‘content-widget-product.php’ to the child theme to modify the code directly (as you suggested in the file) but nothing changed. It appears there is another file that’s associated with the widget.

    I still want to keep the default thumbnail image size in the theme customizer under Woocommerce settings as it is (and only change this size for the ‘products’ widget).

Viewing 4 replies - 1 through 4 (of 4 total)
  • corsonr

    (@corsonr)

    Automattic Happiness Engineer

    Hi there,

    You did well in copying the custom template in the theme folder, now you can edit the following line:

    <?php echo $product->get_image(); // PHPCS:Ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>

    and add a size attribue to get_image(), for instance get_image('my_new_image_size'). You can use ane existing image size or create your own size as per https://docs.woocommerce.com/document/image-sizes-theme-developers/

    Thread Starter blue

    (@life2)

    Thanks. But it’s the same as before, nothing changes when I modify the file. Even when I remove the whole content from the file (and from the original plugin file). I’m not sure what is the problem. I thought there might be another file I will need to modify.

    corsonr

    (@corsonr)

    Automattic Happiness Engineer

    Hey,

    Ok, in that case, better contact theme author, maybe the theme is already using a custom version of this file.

    corsonr

    (@corsonr)

    Automattic Happiness Engineer

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘About changing thumbnail size in widget’ is closed to new replies.