We are trying to change the crop style of the thumbnails attached to the posts on our website. This is the code we have used to declare a new image-size:
<?php
/** --- Thumbnails configuration **/
function add_custom_sizes() {
add_theme_support('post-thumbnails', array('post', 'page', 'custom-post-type-name'));
// Featured size
add_image_size( 'featured-big', 400, 400, true ); // width, height, crop
}
add_action('after_setup_theme','add_custom_sizes');
?>
We then call this image-size while printing out one of our thumbnails:
<?php
the_post_thumbnail( 'featured-big' );
?>
However the thumbnail doesn't seem to be cropped correctly. The parameter true
in the add_theme_support
function is supposed to 'Hard Crop' the image, however the image is 'Soft' cropped, incorrectly.
Any clues?