If you have any experience with
wpgetattachmentthumburl() you’ll know it’s really slow.. It’s a maze trying to figure out why, it just seems to require querying a lot of meta data.
So, to simplify WP’s queries I wrote this function to grab a thumbnail from the image’s full URL:
Then just get my thumbnail with the url
It’s not fool proof – it works for me because I know all my images are jpeg, and I know the URL of the full image, so this takes away all those extra queries (useful when my media plugin is pre-finding thumbnail URL’s of hundreds of images).