Here’s a tiny snippet based a question from Julie:
How can I add a notice right below the WooCommerce featured image on the product page? It should say “click to enlarge” right below the image.
There’s an action that you can use to add content below featured images, which can be used before or after product thumbnails. The woocommerce_product_thumbnail
action is what will help us out. Let’s add a notice that says, “Click to Enlarge” below the featured image.
We’ll use a function to insert this text as a heading below the featured image. You can add this to your child theme or, even better, a code snippet using the Code Snippet plugin.
We’ll now have this displayed right below our featured image.
We could also put this notice below the product thumbnails instead if desired. Use the same snippet, but change the priority from ‘9’ to ’20’ like this:
add_action( 'woocommerce_product_thumbnails' , 'skyverge_add_below_featured_image', 20 );
We’ll end up with a notice after our thumbnails instead:
Unfortunately, some themes override WooCommerce templates and remove this action, so if it doesn’t work, your theme is probably one of these. Otherwise, you can add whatever content is needed to your images!
Hi Beka,
Thanks for that snippet, genius 🙂
I’d like to add that feature to certain products, is it possible???
Many thanks!
Nor
Hey Nor, try wrapping it in a conditional check like described here: https://www.skyverge.com/blog/apply-changes-single-wordpress-page/
You can use the same snippet from this post, but wrap the content inside the function in an
is_single
check for your product IDs rather than the is_page check.Thanks & had copied to code snippets.
Hi Beka,
Thanks for that again 🙂 I was thinking there was a way of conditioning and arraying 🙂 giving it a go now…
Thanks a lot again…
Cheers
Nor
Please tell me how can I add new text box under product image on single page like this site have. http://postimg.org/image/6uzknukbl/
also I add 200×200 px images on product page but size of images on single product page are very large how can I fix it too.
Regards
is there a plugin for this?
I feel that there should.