How to Retrieve the Post Thumbnail URL in WordPress

I think you usually use the the_post_thumbnail( $size, $attr ); function to retrieve the post thumbnail image inside your WordPress template. If you’re creating a custom feature for your theme it could happen you simply need to get the plain url of the post thumbnail. Just paste this code inside the loop code that you are writing and you’re done.