http://stackoverflow.com/questions/23005275/remove-linkurl-to-image-for-woocommerce-products
Will this work?
I really do like to put code in a child theme instead of changing the code direct
You could use the woocommerce_single_product_image_html filter instead. Strip tags except for img
http://php.net/manual/en/function.strip-tags.php
So i have to change both files. There is nothing i can add to child theme?
The filter can be added to a child theme…
add_filter( 'woocommerce_single_product_image_html', 'strip_links_from_woocommerce_single_product_image_html' );
function strip_links_from_woocommerce_single_product_image_html( $html ) {
return strip_tags( $html, '<img>' );
}
Thank you.
It worked perfectly!!!! <3
This could be nice to implent in feature versions of woocommerce. Just under the button of disable woocommerce lightbox, put a new option: disable click on image.
I tried the filter in a child theme but ended up with duplicated product images.
Any thoughts as to what caused this behavior?