0

In my theme's archive template, I'm using

the_post_thumbnail('list-thumb-small');

to get a specific thumbnail size for each post. But that doen's work on all posts. Some posts display their featured image in full size, while others display the correct "list-thumb-small" size.

I have set the custom image size in functions.php:

add_image_size( 'list-thumb-small', 225, 185, true );

Why is this happening and how can I fix it?

1 Answer 1

1

Those might be old images. Image uploaded to WordPress before adding this new image size code will not resize automatically. You will have to resize old images again.

There is a great plugin for that. Use Regenerate Thumbnails plugin to auto generate thumbs for all images. If you ever add a new image size then always resize images again with this plugin.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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