I use this code to display featured image title, caption (excerpt), description (content):
echo get_post(get_post_thumbnail_id())->post_title;
echo get_post(get_post_thumbnail_id())->post_excerpt;
echo get_post(get_post_thumbnail_id())->post_content;
But, how to check if there is any of those fields first?
For example, how to check if there is caption, and if emty to show some other text?
Best regards.