Link to home
Start Free TrialLog in
Avatar of sharingsunshine
sharingsunshineFlag for United States of America

asked on

Need WooCommerce Product Short Code That Uses Thumbnail

this is a  follow-on to this question
https://www.experts-exchange.com/questions/29145248/Need-Custom-Short-Code-For-WooCommerce.html

Open in new window


The image is too large to be useful.  So, is there any way to programmatically create a short-code that does everything in the previous question but uses a thumbnail instead?

I found this
https://wordpress.stackexchange.com/questions/235313/add-the-post-thumbnail-url-to-a-shortcode-in-function-php

Open in new window

but I am not clear how to design what I need.
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

Hi @sharingsunshine,

Can you clarify what you mean by the image is to large to be useful. When you use the [product id="xx"] shortcode it will use the product thumbnail. The size of that thumbnail is defined either by your theme or within the site Customizer.
Avatar of sharingsunshine

ASKER

Then I must have something not set correctly.  Look at https://www.theherbsplace.com/which_calcium_is_best_for_you__sp_92/ and scroll down to coral calcium and that is the same size as my product image for that product.
Nope. Everything's working as it should - the size of the image on that page is the size of the thumbnails throughout the rest of your site. If I go to Shop A-Z and choose a letter (A for example), then all the images on that page are the thumbnail sizes, and they match what you have on your Calcium page.
then what are my options because as you can see if I put all the shortcodes there they will engulf the page with that large of images.
can I change the thumbnail size to what I want and then use a different image for the product page?
ASKER CERTIFIED SOLUTION
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This is the perfect size.  Thanks
I need it to have an add to cart button and price too.  So I will post another question.