WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question

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?.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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