How do I get the URL of a specific size featured image?

You want wp_get_attachment_image_src():

if ( $src = wp_get_attachment_image_src( $attachment_id, $size ) ) {
    echo $src[0]; // URL
    echo $src[1]; // Width
    echo $src[2]; // Height
}

Leave a Comment