Skip to content

Instantly share code, notes, and snippets.

@ekka21
Created July 11, 2012 21:51
Show Gist options
  • Save ekka21/3093863 to your computer and use it in GitHub Desktop.
Save ekka21/3093863 to your computer and use it in GitHub Desktop.
Wordpress: get thumbnail image src
/**
* Desc: Get image source from feature image
* @param $id
* @param $icon = 'thumbnail, medium, large or full'
* @return $image source
*/
function get_me_the_thumbnail_src($id , $size = 'full'){
$tmp = wp_get_attachment_image_src ( get_post_thumbnail_id ( $id ), $icon ) ;
$str = $tmp[0];
return $str;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment