I have a post here:


Where the image is overlapping the sidebar. I wish to shrink the image, but I want something that will do this without me editing the post (why? because the author is not me - and I want an automated system)

Is there a plugin or a CSS solution that can do this? (as cross browser as possible?)


Quick fix via CSS would be using max-width property to style images inside posts. Unfortunately it is very unreliable in Internet Explorer.

.entry img { max-width:500px !important; }

Also in your specific case image has size defined with inline style and it interferes.

Plugin method would involve scanning and changing posts content on the fly, which would probably bring in performance issues, etc.

In my opinion it is better to fix such things consistently on content level. If you have no authority to edit posts show the issue to person who has.

| improve this answer | |
  • Thank you Rarst. I used it and it works (at least for chrome). I understand your suggestion but in this particular case this is not applicable. Thanks again! Tal – Tal Galili Sep 13 '10 at 14:21
  • Hello Rarst - for some reason this doesn't work for me here: food101.co.il/?p=6042 – Tal Galili Sep 15 '10 at 16:14

You could try adding $GLOBALS['content_width'] = 500; to your theme's functions.php file.

| improve this answer | |

Have a look at Ajax Thumbnail Rebuild plugin. Once you re-specify the maximum image width size default under Settings > Media, this plugin will regenerate the thumbnails when the page is loaded.

| improve this answer | |
img {max-width:98%; height: auto;}

use this in your stylesheet.

| improve this answer | |

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.