Check if a post has a featured image and get its URL (outside from the_loop)
|Reported by:||wiltave||Owned by:|
I get posts with get_posts. I didn't find a way to check, outside of the_loop, if a post has a featured image and how to get its URL (for example, wp-content/uploads/month/featured-image.ext).
I've made two functions, please, take a look at the attachment. I've put it in wp-includes/post.php. Maybe you could improve it (if it needs) and include to the core.