Nouvelle #1 en archive

If you’re using WordPress 4.4+ (released in 2015) you can use the get_the_post_thumbnail_url() function to return the URL of the featured post image. This is useful if you want to use the featured image URL in a background-image style or making a unique theme element that specifically needs the featured image URL.

Using the get_post_thumbnail_id() function will allow you to get the media ID of the featured image for a post. This is great when trying to use the media ID for other functions within WordPress.

I hope this was helpful to getting the featured image on your WordPress site. If you have any questions let us know in the comments below!