How to get featured image url of post in wordpress

I know this is very small part code for wordpress but this is very useful call image in background and at that time we need to fetch image url with size. So for this We are displaying here a simple solution through which you can get featured image url of current post. Its depend on you how to use this in loop or simply details page.

Here is simple solution code:

In this code ‘single-post-thumbnail-size’ is the size of image you can directly place size of image like this:

This is tested code which is used in many projects so you can use this code without any issue.

Leave a Reply