Bugfix: picture max-width issue in WP 2.5

If you’ve already upgraded to WordPress 2.5, you may have noticed a problem inserting pictures into your posts: WordPress keeps shrinking them, even if you click on the “insert full size” button

Well, after a little digging, I found out why this is happening. WordPress 2.5 has a new bug i mean feature that makes the default max-width of pictures 500px.

Luckily, the fix is pretty easy. All we have to do is edit a ProPhoto template file to communicate to WP 2.5 that we want to have a different max width. To do so. Go to the “Design” tab in your WP Admin area, and click on “Theme Editor.” Then, select the file called “Theme Functions (functions.php)”. Scroll all the way to the bottom and press return/enter to add a new line and paste in this:

<?php $content_width = 900 ?>

NOTE: It is extremely important that you copy ONLY the code shown above, and not any extra spaces after the last “>” character.  If you leave any extra spaces, it will break your blog.  When you paste in this line, go to the very end of the file and press delete until you are positive there are not extra spaces.

Click “Update File” and you’re good to go.

If you’ve got WordPress 2.5 and you’re not having this issue, you probably downloaded ProPhoto after I added this line to the download file, so you’re all set. But, if you’re still using 2.3.3, when you eventually do upgrade to 2.5, you’ll need to perform this fix. Unless, that is, WordPress decides to remove this silly feature in 2.5.1.

If you want to read the WordPress support thread about this, click here.

7 Responses to “Bugfix: picture max-width issue in WP 2.5”

  1. On Petra Hall said:

    Thanks Jared for posting this fix!! I haven’t uploaded any photo’s yet, so I haven’t had this issue, but now that I know it’ll work when I post again, I can sleep much easier! (This blog idea is a brilliant idea to get through to people fast, and also communicate without having to spend days writing emails.)

  2. On Lisa said:

    Awesome! Thank you for posting this so quickly - very (very) much appreciated!

  3. On Traci said:

    I used this fix, but it broke the blog. I couldn’t access the wp-admin section (or see my blog once I deleted my cache), so I had to upload my original functions file to get it all back. I forgot to copy the error message, but it was something about not being able to modify the header.

    Lisa just said the same thing happened to her. Did we do something wrong, or is the fix not perfect?

    Thanks!

  4. On Jared said:

    I think I know why, i’m editing the post right now to clarify.

  5. On Lisa said:

    Thank you, Jared! All fixed. Thank you a) for the fast response and b) for all the bad things you didn’t say about me when I sent you my panicked e-mail (right?!). LOL

    Thank you!!

  6. On Traci said:

    Thanks!

  7. On Lindsey Bamber said:

    You are my hero! I love pimping up my blog with your help! Thanks so much for all of your help!

Leave a Reply