Getting custom-sized featured image’s URL?

You should use one of the following:

// Thumbnail
wp_get_attachment_thumb_file( $GLOBALS['post']->ID );

// Custom
wp_get_attachment_image_src( $attachment_id, $size="my-thumbnails" );
// Or:
wp_get_attachment_image( $attachment_id, $size="my-thumbnails" );

Leave a Comment