The captions for a standard post's featured image do not display, what changes do I need to make so that the captions are displayed please? ( in Event theme )
thanks
function gk_post_thumbnail_caption($raw = false) {
global $post;
// get the post thumbnail ID
$thumbnail_id = get_post_thumbnail_id($post->ID);
// get the thumbnail description
$thumbnail_img = get_posts(array('p' => $thumbnail_id, 'post_type' => 'attachment'));
// return the thumbnail caption
if ($thumbnail_img && isset($thumbnail_img[0])) {
if($thumbnail_img[0]->post_excerpt != '') {
if($raw) {
return apply_filters('gavern_thumbnail_caption', strip_tags($thumbnail_img[0]->post_excerpt));
} else {
return apply_filters('gavern_thumbnail_caption', '<div class="gk-image-caption">'.$thumbnail_img[0]->post_excerpt.'</div>');
}
}
} else {
return false;
}
}
<?php the_post_thumbnail(); ?>
<?php the_post_thumbnail(); ?>
<?php if(is_single() || is_page()) : ?>
<?php echo gk_post_thumbnail_caption(); ?>
<?php endif; ?>