By default add_image_size
will attempt to resize your custom image sizes instead of cropping them (see the fourth argument in the function).
So you have a couple of options here…
- Perform a crop by passing
true
for the fourth argument ofadd_image_size
, or customize how the crop will be positioned by passing an array for the fourth argument (see documentation). This will force the image dimensions to be resized exactly as defined (for example ‘home-thumbnail-highlight’ will be 694×381) - Set the
height
to a very high value and do not pass a fourth argument for cropping (to perform a resize).
For example:
add_image_size('home-thumbnail-highlight', 694, 99999);
add_image_size('home-thumbnail', 330, 99999);
add_image_size('listing-thumbnail', 342, 99999);
add_image_size('sidebar-small-thumbnail', 300, 99999);
This will force your custom sizes to always constrain at the width instead of the height.