Why are image thumbnails cropped proportionally (not per dimensions)?

For some reason WordPress is ignoring my thumbnail sizes and keeping thumbnails cropped proportionately instead of specific dimensions. Here is what I have in functions.php:

add_image_size( 'main-thumbnail', 728, 410, true );

and in content.php:

<div class="thumbnail">
    <a href="https://wordpress.stackexchange.com/questions/229322/<?php the_permalink(); ?>">
       <?php the_post_thumbnail( 'main-thumbnail' ); ?>
    </a>
</div>

I added these two things and regenerated my images with the Regenerate Thumbnails plugin, but it doesn’t seem to matter. The images don’t change.

For some reason WordPress isn’t recognizing the hard crop and is keeping the images proportional, so some of my images are way taller than 410 pixels. Why is this?

2 Answers
2

Use this plugin to regenerate the images and check the posts .
also check with inspect element to see if the images has 728×410 at the end after the regenerating .https://wordpress.org/plugins/regenerate-thumbnails/

Leave a Comment