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.
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.)
Awesome! Thank you for posting this so quickly – very (very) much appreciated!
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!
I think I know why, i’m editing the post right now to clarify.
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!!
Thanks!
You are my hero! I love pimping up my blog with your help! Thanks so much for all of your help!
Hi Jared,
For some reason, I can post text but my blog will not load the images. I’ve resized them, double checked the size, checked the file names and extensions, changed to Firefox, changed back from Firefox……nothing seems to be working. Oh, did I mention I tried on two different computers in my home, still no help.
Mary
@Mary: can you be a little more specific when you say that your blog “will not load the images”? does your screen freeze when inserting them? what exactly happens?
Hi.
I loaded WP 2.5 last night (after being unable to get a full version of 2.6 to download ….the plugin file in wpcontent is missing and causes errors) and have everything up and working but I am also unable to upload images.
When I attempt to upload from my computer (choosing files no larger that 650 pixels on the long side) I get this:
“Specified file failed upload test”
and all of this above the upload box (although my files are definitely jpegs):
Warning: imagecreatefromstring() [function.imagecreatefromstring]: Passed data is not in ‘JPEG’ format in /mnt/w0108/d43/s14/b02a44b1/www/janetwhalen.com/photoblog/wp-admin/includes/image.php on line 138
Warning: imagecreatefromstring() [function.imagecreatefromstring]: Couldn’t create GD Image Stream out of Data in /mnt/w0108/d43/s14/b02a44b1/www/janetwhalen.com/photoblog/wp-admin/includes/image.php on line 138
Warning: imagecreatefromstring() [function.imagecreatefromstring]: Passed data is not in ‘JPEG’ format in /mnt/w0108/d43/s14/b02a44b1/www/janetwhalen.com/photoblog/wp-admin/includes/image.php on line 138
Warning: imagecreatefromstring() [function.imagecreatefromstring]: Couldn’t create GD Image Stream out of Data in /mnt/w0108/d43/s14/b02a44b1/www/janetwhalen.com/photoblog/wp-admin/includes/image.php on line 138
Any help is very much appreciated!
Thanks in advance,
Janet
Sorry I should have mentioned that the photos currently showing on my blog were imported last night from my typepad blog with no problems at all.
Update….switching to firefox allowed the image to upload, but the image uploader still tells me “Specified file failed upload test” even though it posts successfully. Guess I should only worry about results?
@Janet: my main thought is get a full copy of WP 2.6 from wordpress.org/download and get up to date. in 2.6 they fixed some more image uploading problems, and included an ability to use the older type of image uploader for those having trouble.
Thanks Jared. My problem is that the latest version of 2.6 is causing me problems…..the plugins folder is completely missing every time I download it. Guess I’m stuck with 2.5 for now. In any case, firefox seems to have helped the problem somewhat.
Thanks for all your great Q&A info. on this site. It really helped me when trying to sort through some of these problems.
Seriously happy i found this website, Another good site is Dbol will make sure to take a note of it so i can come to routinely.
Excellent point. The content material that you’ll construct your blogs with now can deliver you numerous income whilst the financial system bounces back.