I’m using a theme which displays a grid of images, but it only works with landscape images at the moment (with portrait images, people’s heads are cut off).

The theme uses custom featured image sizes defined in functions.php through the use of add_image_size().

Is there a way to set the image sizes proportionately to maintain the correct aspect ratio?

1 Answer
1

The code of WordPress states that the fourth variable with the add_image_size() function is value for the crop ‘mode’.

If you that value to ‘false’ (which is default) it’ll keep the aspect ratio of your images.

For example, if you set height and width to both 150×150 and have an image that is 300×200 will become 225×150.

Source: http://codex.wordpress.org/Function_Reference/add_image_size

Leave a Reply

Your email address will not be published. Required fields are marked *