Forum Replies Created

Viewing 1 replies (of 1 total)
  • I use –

    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();

Viewing 1 replies (of 1 total)