custom image size not being displayed in loop

So after a bit of testing I figured out what was wrong. It’s the fact that I used numbers in the custom size name.

WordPress created the custom image sizes fine when I uploaded images. All custom sizes were in my FTP directories and had an extension of 250×250.

The problem is in calling the new size later. WordPress was never doing it.

I added a new custom size:

add_image_size( 'cat-square', 250, 250, true); // cropped

I then re-generated image sizes for just one image to test. The new image size was referenced correctly and shows on the front end.

No new images were actually created though. It was still using the -250×250 version of the image.

So in the end, I removed the 250-square media size, then regenerated all images and everything is good and working!

TL;DR: It appears you can’t use numbers when creating the name for custom image sizes in wordpress.