Function to get custom post image URL

Function to get custom post image URL

Note that when used outside The Loop on a posts page (index, archive, etc.) without the ID parameter, it will return the URL of the last post in The Loop, not the permalink for the current page.

Leave a comment

Your email address will not be published.