Disable srcset (image responsiveness) when loading woocommerce_thumbnail
-
As the title says, I need to disable srcset for images which has woocommerce_thumbnail as a class. Basically I want the woocommerce thumbnails in shop page, category page, checkout page, wishlist page and in pages of any other plugins that call for woocommerce_thumbnail to load at 500px regardless of the device or screen resolution.
The code for stopping srcset across the entire wordpress is given below. I need to attach a condition to it so that this code gets applied only when woocommerce_thumbnail is called.
add_filter(‘wp_calculate_image_srcset_meta’,’__return_null_and_remove_current_filter’);function __return_null_and_remove_current_filter ( $var )
{remove_filter( current_filter(), __FUNCTION__ );
return null;}The page I need help with: [log in to see the link]
The topic ‘Disable srcset (image responsiveness) when loading woocommerce_thumbnail’ is closed to new replies.