Title: Products shortcode srcset
Last modified: June 28, 2018

---

# Products shortcode srcset

 *  Resolved [Delite Studio](https://wordpress.org/support/users/delitestudio/)
 * (@delitestudio)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/products-shortcode-srcset/)
 * I’m inserting product images in the sidebar. I’m using a text widget with the`
   products` shortcode, for example:
 * `[products ids="20648"]`
 * The corresponding image contains the correct srcset, but the images that are 
   loaded are too large (and Google’s PageSpeed Insights complains). You can see
   an example here (see the right sidebar):
 * [https://cuneotrekking.com](https://cuneotrekking.com)
 * Do you have any idea how I could solve it?
 * Thanks!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fproducts-shortcode-srcset%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 10 replies - 1 through 10 (of 10 total)

 *  Plugin Support [Ryan Ray](https://wordpress.org/support/users/ryanr14/)
 * (@ryanr14)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/products-shortcode-srcset/#post-10444627)
 * Hi [@delitestudio](https://wordpress.org/support/users/delitestudio/),
 * There isn’t a way unfortunately to control the image used, it looks to use the
   product image size by default without an option to say use the thumbnail size.
 *  Thread Starter [Delite Studio](https://wordpress.org/support/users/delitestudio/)
 * (@delitestudio)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/products-shortcode-srcset/#post-10444656)
 * Thanks for your answer! In your opinion there is another way that allows me to
   show a product (with photo, title, price and purchase button) but with a smaller
   image that can fit well in the sidebar?
 * Thanks again for your time.
 *  [Kenin](https://wordpress.org/support/users/kbassart/)
 * (@kbassart)
 * Automattic Happiness Engineer
 * [7 years, 11 months ago](https://wordpress.org/support/topic/products-shortcode-srcset/#post-10445731)
 * Hi there,
 * I tested this with our Storefront theme, and the Products shortcode functions
   well in the Sidebar as seen in the screenshot here: [http://cld.wthms.co/PNbOY](http://cld.wthms.co/PNbOY)
 * If it’s loading too large with your theme, you may want to contact your theme
   developer for assistance to see if they can help get the image size adjusted 
   for you.
 *  Thread Starter [Delite Studio](https://wordpress.org/support/users/delitestudio/)
 * (@delitestudio)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/products-shortcode-srcset/#post-10448027)
 * Hello Kenin,
 * I’m not sure it’s a problem of our theme (which is custom made), because the 
   shortcode works perfectly also in our theme, as you can see by going to the cuneotrekking.
   com home page, but the images shown are larger than what would be sufficient…
   but I could miss something 🙂
 * Thanks for your time!
 *  [jessepearson](https://wordpress.org/support/users/jessepearson/)
 * (@jessepearson)
 * Automattic Happiness Engineer
 * [7 years, 11 months ago](https://wordpress.org/support/topic/products-shortcode-srcset/#post-10448607)
 * [@delitestudio](https://wordpress.org/support/users/delitestudio/) It looks like
   your theme is setting your thumbnail size to 750px wide, which will give you 
   a much larger image than what is needed. This can be seen in your regular shop
   page, as well:
 * 
    Link to image: [http://cld.wthms.co/dCDrFb](http://cld.wthms.co/dCDrFb)
 * The default width for these images is 300px, which should be all that is ever
   needed.
 *  Thread Starter [Delite Studio](https://wordpress.org/support/users/delitestudio/)
 * (@delitestudio)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/products-shortcode-srcset/#post-10448723)
 * Thanks. Not sure if I’m missing something, but I do not understand where that
   750px comes out, because in reality the sizes are set in this way under Settings
   → Media:
 * [https://cuneotrekking.com/wp-content/uploads/wc-shot1.png](https://cuneotrekking.com/wp-content/uploads/wc-shot1.png)
 * Moreover, when I load a media here are the files that are generated in the wp-
   uploads folder:
 * [https://cuneotrekking.com/wp-content/uploads/wc-shot2.png](https://cuneotrekking.com/wp-content/uploads/wc-shot2.png)
 * As you can see there are many sizes smaller than 750px…
 * These are the `add_theme_support()` in our theme:
 *     ```
       add_theme_support('woocommerce');
       add_theme_support('wc-product-gallery-zoom');
       add_theme_support('wc-product-gallery-lightbox');
       add_theme_support('wc-product-gallery-slider');
       add_theme_support('post-thumbnails');
   
       add_image_size('cuneotrekking', 800, 533);
   
       update_option('thumbnail_size_w', 170);
       update_option('medium_size_w', 470);
       update_option('large_size_w', 970);
       ```
   
 * Any ideas?
 * Thanks!
    -  This reply was modified 7 years, 11 months ago by [Delite Studio](https://wordpress.org/support/users/delitestudio/).
    -  This reply was modified 7 years, 11 months ago by [Delite Studio](https://wordpress.org/support/users/delitestudio/).
 *  [jessepearson](https://wordpress.org/support/users/jessepearson/)
 * (@jessepearson)
 * Automattic Happiness Engineer
 * [7 years, 11 months ago](https://wordpress.org/support/topic/products-shortcode-srcset/#post-10448764)
 * [@delitestudio](https://wordpress.org/support/users/delitestudio/) Install [Simple Image Sizes](https://wordpress.org/plugins/simple-image-sizes/),
   then go back to the Media page to see what the `woocommerce_thumbnail` image 
   size is set to.
 *  Thread Starter [Delite Studio](https://wordpress.org/support/users/delitestudio/)
 * (@delitestudio)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/products-shortcode-srcset/#post-10448839)
 * Bingo! I can see `woocommerce_thumbnail`, `woocommerce_single`, `shop_catalog`,
   and `shop_single` all set to 750px. That’s great: so I should change these values
   and then regenerate the thumbnails. I imagined it was not just a matter of theme
   🙂
 * Thank you very much for your time!
 *  [jessepearson](https://wordpress.org/support/users/jessepearson/)
 * (@jessepearson)
 * Automattic Happiness Engineer
 * [7 years, 11 months ago](https://wordpress.org/support/topic/products-shortcode-srcset/#post-10448959)
 * [@delitestudio](https://wordpress.org/support/users/delitestudio/)
 * > so I should change these values and then regenerate the thumbnails
 * Correct. Those are not the default sizes, so something had to update them at 
   some point.
 *  [Kenin](https://wordpress.org/support/users/kbassart/)
 * (@kbassart)
 * Automattic Happiness Engineer
 * [7 years, 11 months ago](https://wordpress.org/support/topic/products-shortcode-srcset/#post-10468933)
 * 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 10 replies - 1 through 10 (of 10 total)

The topic ‘Products shortcode srcset’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

 * [products](https://wordpress.org/support/topic-tag/products/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)
 * [srcset](https://wordpress.org/support/topic-tag/srcset/)

 * 10 replies
 * 4 participants
 * Last reply from: [Kenin](https://wordpress.org/support/users/kbassart/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/products-shortcode-srcset/#post-10468933)
 * Status: resolved