WordPress.org

Ready to get started?Download WordPress

Forums

Image size (15 posts)

  1. richmaster
    Member
    Posted 6 years 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

  2. richmaster
    Member
    Posted 6 years 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.

  3. jaredh123
    Member
    Posted 6 years 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.

  4. Clicknathan
    Member
    Posted 6 years ago #

    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.

  5. nathanrice
    Member
    Posted 6 years ago #

    @clicknathan - can you link to the documentation of that? Where did you find it?

  6. jaredh123
    Member
    Posted 6 years ago #

    clicknathan,

    thanks, that worked. inserted

    <?php $content_width = 900 ?>

    into my theme's function file.

    much appreciated.

  7. colombo79
    Member
    Posted 6 years 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.

  8. technabob
    Member
    Posted 6 years 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?

  9. colombo79
    Member
    Posted 6 years 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.

  10. technabob
    Member
    Posted 6 years ago #

    I agree. I don't think it should automatically add widths, because scaling images in HTML just plain sucks.

  11. vandiumsw
    Member
    Posted 6 years 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

  12. logicalnot
    Member
    Posted 6 years 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

  13. logicalnot
    Member
    Posted 6 years ago #

    OK — never mind. I fix it.

    I just pasted
    $GLOBALS['content_width'] = 960;
    somewhere in the functions.php file and it now works.

  14. red88music
    Member
    Posted 6 years ago #

    I have tried do as suggested, but adding:

    $content_width = 600;
    $GLOBALS['content_width'] = 600;

    to my functions.php file did not work.

  15. luxcious
    Member
    Posted 6 years 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.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.