How to get WordPress post featured image URL
Asked 07 September, 2021
Viewed 2.8K times
  • 55
Votes

I am using this function to get the featured images:

<a href="#" rel="prettyPhoto">
    <?php the_post_thumbnail('thumbnail'); ?>
</a>

Now I want to get the full featured image on click on the anchor tag for which I need a featured image URL in

<a href="here" rel="prettyPhoto">

How can I fix this?

20 Answer