Created
December 24, 2013 17:52
-
-
Save johnmorris/8116213 to your computer and use it in GitHub Desktop.
Get the thumbnail source URL in WordPress
This file contains 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 wp_get_thumb_src($post = false, $size = 'thumbnail') { | |
if ( ! $post ) { | |
global $post; | |
} | |
$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