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'm running a family wordpress blog: http://www.kjirstiandtom.com

We have a lot of pictures we put up for family. I'm using the twenty-eleven theme, which I love. I did minor css edits to change colors and fonts, but it's otherwise pretty much stock.

Resizing works great... until you get really skinny (e.g. iphone screen). if you resize the browser window, you see that the pictures width starts to resize, but the picture height does not. Any tips?


share|improve this question
Interesting... Removing the inline height attribute in the image tag seems to solve the issue. I did also notice that your images don't have the default classes that images will generally have when inserted. I don't know if that is relevant, but an observation... – Dan Feb 3 '13 at 6:29

Here is a quick function to remove the width and height attributes from images which should resolve your issue.

function _remove_img_dimensions_WPA84292($html) {
  $html = preg_replace('/(width|height)=["\']\d*["\']\s?/', "", $html);
    return $html;
//for new images
add_filter('post_thumbnail_html', '_remove_img_dimensions_WPA84292', 10);
add_filter( 'image_send_to_editor', '_remove_img_dimensions_WPA84292', 10 );
//for images already inserted into posts
add_filter('the_content', '_remove_img_dimensions_WPA84292', 10);
share|improve this answer

try to add CSS

.entry-content img { max-width: 100%; height: auto; }

This should set image height automatically and fix your issue.

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.