Get the bare URL for an attachment

I’m trying to get the link to the thumbnail size of an attachment image.

I tried this:

Read More
wp_get_attachment_link( $img_id, 'thumbnail' );

but it returns the actual HTML for the image wrapped in a link. I want just the bare URL directly to that size image.

Does WordPress have a different function I should be using, or do I have to extract it from the HTML returned by wp_get_attachment_link?

Related posts

Leave a Reply

1 comment