Skip to content

Instantly share code, notes, and snippets.

@johnnyicarus
Created January 15, 2013 23:25
Show Gist options
  • Save johnnyicarus/4543124 to your computer and use it in GitHub Desktop.
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.
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