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.
Further Reading on Blogging
- Pruning blog posts from syndication feeds
- How to create a Twitter book reading list
- Blog conference in Indiana, mid-August
Further Reading on HTML and CSS
- Hiding an email address from spambots and spiders
- CSSsprite: Photoshop script combines two images for CSS hover
- Features and characteristics of a great 404 error page






November 5th, 2008 at 1:16 pm
Thanks, just what I needed.
November 12th, 2008 at 7:31 pm
Thank you! My writers were driving me nuts by always leaving the default size of medium checked off, and this did the trick!
June 26th, 2009 at 5:33 am
Do you know how to do this for wp 2.8?
thanks.
June 26th, 2009 at 8:11 am
@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).
November 6th, 2009 at 3:18 pm
Thank you thank you thank you! Just saved me a couple of hours of minor image resizes. Worked like a charm
March 9th, 2010 at 3:20 pm
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.
March 9th, 2010 at 3:45 pm
@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).
March 9th, 2010 at 11:39 pm
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!
March 11th, 2010 at 10:27 pm
@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.