Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function get_image_caption() {
- global $page;
- //handle video post format
- if (get_post_format($this->post->ID) == 'video') {
- //if it's a video post...
- $td_post_video = td_util::get_post_meta_array($this->post->ID, 'td_post_video');
- //render the video if the post has a video in the featured video section of the post
- if (!empty($td_post_video['td_video']) && class_exists( 'td_video_support')) {
- return td_video_support::render_video($td_post_video['td_video']);
- }
- } else {
- //if it's a normal post, show the caption
- if (!is_null($this->post_thumb_id)) {
- $featured_image_id = get_post_thumbnail_id($this->post->ID);
- $featured_image_info = td_util::attachment_get_full_info($featured_image_id);
- // caption - put html5 wrapper on when we have a caption
- if (!empty($featured_image_info['caption'])) {
- $buffy = '';
- $buffy .= '<figcaption class="wp-caption-text">' . $featured_image_info['caption'] . '</figcaption>';
- $buffy .= '</figure>';
- }
- $buffy .= '</div>';
- return $buffy;
- } else {
- return ''; //the post has no thumb
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment