Created
January 15, 2013 23:25
-
-
Save johnnyicarus/4543124 to your computer and use it in GitHub Desktop.
Function that returns the URL of a post thumbnail in Wordpress inside the loop. Used for displaying FlexSlider 2 thumbnail navigation.
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 prefix_thumbnail_url( $postid ) { | |
$post_image_id = get_post_thumbnail_id( $postid ); | |
$thumbnail = wp_get_attachment_image_src( $post_image_id, $image-size, false); | |
if ($thumbnail) (string)$thumbnail = $thumbnail[0]; | |
return $thumbnail; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment