Image Caption in Excerpt

  • OPShots

    #41705

    It does not show at all. Yep the caption is entered in the media caption field.

    Anonymous

    #41706

    That’s strange, on my testsite it’s working:

    link_printscreen

    and I only have this in child-theme functions.php:

    function featured_image_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 class="thumb_excerpt">'.$thumbnail_image[0]->post_excerpt.'</span>';
    }
    }
    add_action('graphene_after_post_content', 'featured_image_caption')

Viewing 2 posts - 11 through 12 (of 12 total)

  • 1
  • 2
  • You must be logged in to reply to this topic.