Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

add_image_size crop only portrait pictures

$
0
0

Replies: 0

Hi I’m hoping for a quick solution to this:
Is there any way that add_image_size can resize landscape images to a width of say 300px without cropping but crop portrait images to 300px by 300px? I know how to do those in 2 separate instances so:

add_image_size( '300-landscape', 300 );
add_image_size( '300-square', 300, 300, true );

but I either need to have one instance of add_image_size that resizes or crops depending on dimensions or find a way on my page to deliver the 300-landscape image or the 300-square image depending on original picture dimensions.

Any pointers would be much appreciated. Thanks


Viewing all articles
Browse latest Browse all 59525

Trending Articles