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!

9 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).

  5. Robin Bastien Says:

    Thank you thank you thank you! Just saved me a couple of hours of minor image resizes. Worked like a charm

  6. Nicole Says:

    I would like to print an image from the gallery. I have attached each image to the image file. The orignal images are A4. Once I open it from the gallery it prints on half a page (half an A4 page). How do I get it to print on the entire page? Any help with me much appreciated.

  7. Stephen james Says:

    @Nicole

    I’m not completely sure what you are asking. I wasn’t aware that you could print images directly from the WordPress gallery. If you wanted to allow readers to print an image, I’d recommend linking to the full size image in the blog post and then tell them to print it in the browser. It would shrink to the page size (unless of course, your image is too small to begin with).

  8. Nicole Says:

    Thanks for your reply.
    I did link to the full size image in the blog post and then tell them to print it in the browser.
    For some reason the portrait images dont shrink and come out A4 but the landscape do shrink. The entire site is images to be downloaded and printed.
    http://www.rewardchartsforchildren.co.uk
    any way to enable them to print full size images? Maybe a plugin or something?
    Thanks again!

  9. Stephen James Says:

    @Nicole

    The size of the printing of the image has nothing to do with WordPress. It’s a browser/printer issue. If it’s a horizontal image, it needs to be printed landscape. The other option is that you could rotate the image, if you don’t want to tell viewers that they need to go into their printer settings and change the layout orientation to “Landscape” and not print in “Portrait” mode.

Leave a Reply


Books Now Reading

My Sites