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

Read more posts like 'Change media and images to full size in WordPress media gallery'

Leave a Reply


Books Now Reading

My Sites