I want to display the featured image outside of the WP-loop. e. g. like a background image of the body that is different in every post. I looked for two hours on google, but could not find a single piece of code that gives me an idea. But I suppose it is not that much complicated.
Has anybody here an idea how the retrieve the URL of the featured image outside the loop?
thank"
2
Answers
Try This:
To get the url use:
Here’s my preferred way: