Why is wp_get_attachment_image_src not working with my custom size (add_image_size)

I have added an image size with

add_image_size('gallery-thumb', 48, 48);

Why when I do

array_slice(wp_get_attachment_image_src($firstimg->ID, 'gallery-thumb'))

I get the link to the full sized image?

UPDATE

Somehow it appears that even when I do

wp_get_attachment_image_src($photo->ID, array(48,48))

I get the thumbnail image (150, 150)

2 s
2

Does the 48×48 thumbnail file exist? If not, you can use a plugin like Regenerate Thumbnails.

Leave a Comment