[Plugin: Meteor Slides] Add featured image caption to each slide
-
For people who want to show the caption instead of the title, you can use this function in your theme:
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>'; } }
Usage –
the_post_thumbnail_caption();
and add line height to the suggested custom template CSS:
.meteor-slides p { line-height: 1.2; }
because the default line-height: 0 causes long captions to wrap over themselves.
The function is from this discussion:
https://www.ads-software.com/support/topic/display-caption-with-the_post_thumbnailI also got rid of the span tag echo.
Now, if I can do the jquery to make the caption slide up and down, as it does on the old s3slider.js, I’d be thrilled! Any suggestions out there?
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘[Plugin: Meteor Slides] Add featured image caption to each slide’ is closed to new replies.