Last active
October 23, 2015 07:18
-
-
Save yratof/e073592534bd6708a9b8 to your computer and use it in GitHub Desktop.
Function for getting the featured image URL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get_thumbnail_url($size) { | |
$image_id = get_post_thumbnail_id(); | |
$image_url = wp_get_attachment_image_src($image_id, $size, true); | |
if (has_post_thumbnail()) { echo $image_url[0]; } | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment