Max-width for full size images in Post & Editor
-
For several reasons I wanted to place full size images into some posts, but needed to have them scale down automatically so that they would fit in the themed post. This is not possible with CSS because of the width and height specified in the img tags, that override CSS. I searched here on the forums but couldn’t get a suitable answer.
The solution I found is a hack and actually very simple. Open media.php in the includes directory and seach for (± line 70):
// $size == 'full' has no constraint else { $max_width = $width; $max_height = $height; }
change to:
// $size == 'full' has no constraint else { $max_width = '677'; $max_height = $height; }
whereas 677 represents the maximum pixel width you want, so adjust that number. Remember to do this again after upgrading your WordPress version.
And it works in the editor as well.
- The topic ‘Max-width for full size images in Post & Editor’ is closed to new replies.