Get wordpress post thumbnail url

This post focuses on getting the posts’ thumbnail url for a post in the wordpress. To do this, all we need is post’s id.

Here’s how this can be done

$url = wp_get_attachment_url( get_post_thumbnail_id ( $id_of_the_post ) );

// $id_of_the_post = the id of post whose thumbnail url you wish to obtain.

Leave a Reply

Your email address will not be published. Required fields are marked *