When uploading images via the media manager there are a couple of set sizes available such as thumb, medium and large.

I do know how to add additional sizes, but I have yet to get it to insert an image with width='x%'.

the concept is that i am building an adaptive theme and I never want the inserted image to be larger than the container even upon browser resize,

By manually editing the inserted image code to include widths with a %, then it works just fine. However trying to get my users to remember this is downright impossible.

What I would like would be a button to insert an image into a post with a set % (percentage) instead of a set pixel width.


1 Answer 1


I guess what you're looking for is the $content_width global that would basically limit the width of your images, used in functions.php. Some more info here: http://mainstreetopen.com/wordpress-26-and-full-width-images/

  • Not really right. I am more looking to have the image inserted and then have the image width="70%" added to the image wrapper code. This will give me a consistent look across most browser sizes including mobile. Doing it the way you point to still causes problems. Say the user inserts an image only 400px wide, which looks rather small on a large monitor, but is very large on an iphone, Using a % on the width attribute solves this
    – shawn
    Apr 29, 2011 at 7:43
  • example: live.wptumble.com/index11.html image thumbs are animated gifs so I can't allow them to be resized when inserted into the post. I use a % on the width to keep the page looking decent on both large/small devices.... of course is someone has built a wp plugin to auto resize animated gifs,,, wow that would be cool
    – shawn
    Apr 29, 2011 at 7:45
  • How about setting the % size through CSS? The image size is appended to the image as a class.
    – kovshenin
    Apr 29, 2011 at 11:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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