Change media and images to full size in WordPress media gallery

I’ve been familiarizing myself with WordPress 2.5’s new media gallery. If you’ve visited my blog before, you know I don’t upload many images, but I’m hoping to upload many images to my wife, Rachel Steely’s website. I was annoyed to find out that the default image posting size is medium (which is about 300px). On top of that, if you select full size, it doesn’t mean full size. It means your WordPress theme’s column width. So unless you are using Kubrick your media size will not be your column width.

Change Full Size image width to match theme

The column width in Wordpress’s default theme Kubrick is 500px. Therefore, the default (maximum) image size is 500px. The column width of the blog I am posting to is 614px. You can set a global variable to change this setting. Create if not already existing functions.php in your theme directory. Define your maximum media width (that is “Full Size” in the Gallery interface):

<?php
$content_width = 614;
?>

I’ve set mine to 614 pixels since that is the width of my div with the class “.entry” minus padding. If this does not work, some have solved this problem with $GLOBALS['content_width'] = 614; also. You can view this setting at a post at RachelSteely.com.

Default media to Full Size

I prefer to justify my media (align left and right) to the column width. To do this, set default selected size to “Full Size” by changing the code in /wp-admin/includes/media.php. Move the ‘checked’ radio attribute from Medium to Full Size.

Line 458:

” : ” ) . “<input type=’radio’ name=’attachments[$post->ID][image-size]‘ id=’image-size-medium-$post->ID’ value=’medium’ checked=’checked’ />
<label for=’image-size-medium-$post->ID’>” . __(’Medium’) . “</label>
<input type=’radio’ name=’attachments[$post->ID][image-size]‘ id=’image-size-full-$post->ID’ value=’full’ />

change to

” : ” ) . “<input type=’radio’ name=’attachments[$post->ID][image-size]‘ id=’image-size-medium-$post->ID’ value=’medium’ />
<label for=’image-size-medium-$post->ID’>” . __(’Medium’) . “</label>
<input type=’radio’ name=’attachments[$post->ID][image-size]‘ id=’image-size-full-$post->ID’ value=’full’ checked=’checked’ />

And that’s it! Happy uploading with the new and improved (and customized) WordPress media gallery.

If you have found this post valuable, please share it with others: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Facebook
  • del.icio.us
  • Google
  • StumbleUpon
  • TwitThis

A note about the author

Photograph of Stephen JamesMedia designer with experience in interactive, print and video. I have a marketing and advertising agency background and currently work full-time at a full-service agency. Visit my contact page, even if you would just like to say hello. To stay in touch, follow me on Twitter or connect on a variety of other social networks. Thanks for stopping by!

4 Responses to “Change media and images to full size in WordPress media gallery”

  1. Gabi Says:

    Thanks, just what I needed.

  2. Zander Chance Says:

    Thank you! My writers were driving me nuts by always leaving the default size of medium checked off, and this did the trick!

  3. Harry Says:

    Do you know how to do this for wp 2.8?

    thanks.

  4. Stephen James Says:

    @Harry

    I believe setting the $content_width is the same. I could be wrong, but I think you can get the same effect (for Default media to Full Size) by setting the medium image’s max width to your content width and keep the default set to medium. You can set that size in the admin (Tools>>Media).

Leave a Reply


My Sites