richmaster
Member
Posted 5 months ago #
Hello
I just upgraded to 2.5 and am looking for a solution to a problem I've come across. When I upload an image I choose "full size" and then insert it into the post. The problem is that it doesn't add the image full size.
For example, I have my thumbnails set as default, medium pictures set at 300 width and 300 height. Then when I upload an 650 x 650 image and choose "full size" and insert it into a post the image is resized to 500 width.
The image itself isn't actually being resized, but rather scaled down with html.
Anyone know how to resolve this?
Thanks1
richmaster
Member
Posted 5 months ago #
Found the solution myself.
Turns out Wordpress rescales the image with html (like said above). The change it you need to edit wp-includes/media.php
On line 34 look for $max_width = 500; and change the 500 to whatever you'd like. This should seriously be a setting in the dashboard.
jaredh123
Member
Posted 4 months ago #
yes, this is frustrating. is there a way for theme writers to have the theme pass their own max width to WP so that users don't have to edit this file?
thanks for any help.
For theme writers, or anyone else who can edit their theme, try adding the following to your functions.php file:
$content_width = 650; // pixels
You'll have to add that between some <?php> tags.
@clicknathan - can you link to the documentation of that? Where did you find it?
jaredh123
Member
Posted 4 months ago #
clicknathan,
thanks, that worked. inserted
<?php $content_width = 900 ?>
into my theme's function file.
much appreciated.
colombo79
Member
Posted 4 months ago #
yea, this should definitely be a dashboard function.
also if i submit a full size image it still links to a new page with the exact same full size image...
and finally media uploader should allow for preferred image format definition.
technabob
Member
Posted 4 months ago #
I tried this in the theme's functions.php and it didn't work. It only seems to work for me if I modify the wp-includes/media.php file -- ugly.
Any ideas?
colombo79
Member
Posted 4 months ago #
technabob,
the only ugly thing into it is that the width limitation shouldn't be there in the first place, or being there it should be possible to change via dashboard... huge feature flaw.
changed the media.php file and it worked fine.
technabob
Member
Posted 4 months ago #
I agree. I don't think it should automatically add widths, because scaling images in HTML just plain sucks.
vandiumsw
Member
Posted 4 months ago #
Just curious did you search on the forum before posting?
This question was already answered shortly after 2.5 released: Same answer but with one added option.
http://wordpress.org/support/topic/164667?replies=12
logicalnot
Member
Posted 4 months ago #
Hi
I am using the Hemingway theme on WP 2.5.1. Unfortunaly, just pasting
<?php $content_width = 900 ?>
doesn't work.
I have this message coming up :
Warning: Cannot modify header information - headers already sent by (output started at /mnt/MY_DATABSE_ADDRESS/wp-content/themes/MY_THEME/functions.php:3) in /mnt/MYDATABSEADDRESS/www/MY_WORDPRESS/pluggable.php on line 694
logicalnot
Member
Posted 4 months ago #
OK — never mind. I fix it.
I just pasted
$GLOBALS['content_width'] = 960;
somewhere in the functions.php file and it now works.
red88music
Member
Posted 3 months ago #
I have tried do as suggested, but adding:
$content_width = 600;
$GLOBALS['content_width'] = 600;
to my functions.php file did not work.
luxcious
Member
Posted 2 months ago #
This is indeed an annoying bug, and still seems to exist in WP 2.5.1.
I just discovered this and now have to go through all my images that have already been inserted into pages to get the correct size.