srcset responsive attribute interferes with product designer replacing product image

Posted over 6 years by Jeremy Aaron Horland

Post a topic
Answered
J
Jeremy Aaron Horland

Problem -- and simple solution.


The introduction of the responsive product media image in wordpress 'srcset' attribute has started to interfere with the loading of product custom images in the woocommerce custom product image display screens.


To correct for this is simple as a short term solution :


1) load your favorite on-page or short-code Javascript editor as a plug in. I used : "OH Add Script Header Footer"


2) add the following code on the product or page on which you want to re-enable product custom imagesĀ 


<script type='text/javascript'>

jQuery("img.wp-post-image").removeAttr("srcset");

</script>


-- this has re-enabled an essential feature on my pages.


0 Votes

D

Deleted Agent posted over 6 years Best Answer

thanks

0 Votes


1 Comments

D

Deleted Agent posted over 6 years Answer

thanks

0 Votes

Login or Sign up to post a comment