Hi there,
Can you try this code instead:
add_action( 'generate_before_content', 'db_featured_image_caption', 15 );
function db_featured_image_caption() {
$get_description = get_post(get_post_thumbnail_id())->post_excerpt;
if(!empty($get_description) && is_single() ){
echo '<div class="featured_caption">' . $get_description . '</div>';
}
}
Then this CSS:
.featured_caption {
text-align: center;
}
Adding CSS: https://docs.generatepress.com/article/adding-css/
If this doesn’t work, we’d need to see the live site.
Let me know ๐