Skip to content

Instantly share code, notes, and snippets.

@reactormade
Created January 12, 2014 16:59
Show Gist options
  • Save reactormade/8387357 to your computer and use it in GitHub Desktop.
Save reactormade/8387357 to your computer and use it in GitHub Desktop.
/**
* RETORNA URL DO POST_THUMBNAIL PARA BACKGROUND-IMAGE
* @param int: get_the_ID()
* @param string: thumbnail, medium, large, full
**/
function post_thumbnail_url($post_id, $size = 'thumbnail'){
$thumb = wp_get_attachment_image_src(get_post_thumbnail_id($post_id), $size );
$url = $thumb[0];
return $url;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment