How to disable click and zoom on product images?

[ad_1]

Hi @gemini23,

Glad you reached out, happy to help.

You can try using this custom filter to disable the product image hyperlink:

function e12_remove_product_image_link( $html, $post_id ) {
    return preg_replace( "!<(a|/a).*?>!", '', $html );
}
add_filter( 'woocommerce_single_product_image_thumbnail_html', 'e12_remove_product_image_link', 10, 2 );

Here is how to add the custom filter to your website using the Code Snippets plugin:
https://www.kadencewp.com/help-center/docs/kadence-theme/how-to-add-a-custom-filter-or-function-with-code-snippets/

I hope this helps. Please let us know how we can help further.

Cheers,
Eze

Hurray! Thanks Eze, this worked.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer