Created
July 23, 2015 08:57
-
-
Save Faisalawanisee/d81e5ebc22428963f79a to your computer and use it in GitHub Desktop.
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 the_post_thumbnail_caption() { | |
global $post; | |
$thumbnail_id = get_post_thumbnail_id($post->ID); | |
$thumbnail_image = get_posts(array('p' => $thumbnail_id, 'post_type' => 'attachment')); | |
if ($thumbnail_image && isset($thumbnail_image[0])) { | |
echo '<span>'.$thumbnail_image[0]->post_excerpt.'</span>'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment