1

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

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

and I have this in my content.php:

<div class="thumbnail"><a href="<?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?

0

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

0

You might wanna try registering image sizes using after_setup_theme action hook.

add_action('after_setup_theme', function() {
  add_image_size('main-thumbnail', 728, 410, true);
});

Also, if you have access to the Wordpress CLI, it is way better for regenerating images - wp media regenerate and you can also check all your registered sizes with wp media image-size

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.