Support » Plugins » Image Max width set with $GLOBALS[‘content_width’] is being applied to height

  • So this is confusing me.
    I’ve set my thumbnail and medium size images through the dashboard, and,

    because I want all my images at full size to be scaled down (if theyre originally bigger) to a 500 pixel width, with no limit on how tall they are,

    I put this code at the top of my functions.php file:

    <?php $GLOBALS['content_width'] = 500; ?>

    which worked great until todays post had a vertical image. At full size it’s height was limited to 500px, leaving the width at 375 and too skinny and funny looking inside my design expecting it to take up 500px width.

    i specified content_WIDTH did i not? why is it applying it to height?

    or is the code above not what I was supposed to do?

    Any help would awesome! Thanks!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • anybody been confused by this before?

    if anyone else finds this, i figured it out after digging around some more.

    set <?php $GLOBALS[‘content_width’] = 500; ?> in functions.php

    then comment out line 84 in media.php:

    // any other type: use the real image and constrain it
    // list( $width, $height ) = image_constrain_size_for_editor( $meta['width'], $meta['height'], $size );

    and the WIDTH is set to 500 and not just the longest dimension. ta da!
    got it from parisoto’s reply here:

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Image Max width set with $GLOBALS[‘content_width’] is being applied to height’ is closed to new replies.