Website Building » WooCommerce » How Do I Make a WooCommerce Image Clickable?

How Do I Make a WooCommerce Image Clickable?

Last updated on October 1, 2022 @ 9:19 pm

There are a few ways that you can make an image clickable using WooCommerce. One way is to use the built-in image gallery feature.

This can be found in the main menu under WooCommerce > Settings > Products > Display. Enable the Enable lightbox option and then click Save changes.

Your images will now be clickable and will open in a lightbox when clicked.

If you don’t want to use the lightbox feature, or if you want more control over how your images are displayed, you can use the WooCommerce Product Image shortcode. This shortcode allows you to control the size, alignment, and link behavior of your images.

To use the WooCommerce Product Image shortcode, simply add the following code to the product page where you want the image to appear:

[woocommerce_product_image]

This will display the featured image for the product. You can also add a specific image size by adding an “image_size” attribute:

[woocommerce_product_image image_size=”medium”]

You can also align your images using the “align” attribute:

[woocommerce_product_image align=”left”]

PRO TIP: If you are not familiar with HTML or CSS, we do not recommend attempting to make a WooCommerce image clickable. Depending on the theme you are using, making a small change to the code could result in your entire website breaking. If you are not comfortable with code, we recommend reaching out to a developer for help.

If you want your images to link to the product page, you can add the “link” attribute:

[woocommerce_product_image link=”true”]

You can also link your images to other pages, such as the product’s category page or a custom URL. To do this, just add the “url” attribute:

[woocommerce_product_image url=”http://example.com/”]

The WooCommerce Product Image shortcode is a great way to control how your images are displayed on your product pages. With a few simple attributes, you can easily make your images clickable and link them to other pages on your site.

Madison Geldart

Madison Geldart

Cloud infrastructure engineer and tech mess solver.