0

I wish that when the browser was resized to below 980px, my images were width 100%. The container of the images already have 100%, the problem is that I'm using wordpress size code for thumbnails:

add_theme_support ('post-thumbnails');
add_image_size ('portfolio1', 600, 344, true);

So I thought to use this code to remove the image sizes:

jQuery (document). ready (function ($) {
     $ ('img'). RemoveProp ('width'). RemoveProp ('height');
});

The problem is that I do not know how it would look for smaller sizes that 980px browser. I do not know if this is the best way. I Would like some help Thank you

0

This snippes should remove the height and width attributes of the images: https://gist.github.com/stuntbox/4557917

Maby you would extend the code to only strip out the attributes on images larger than 980px?.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.