Hello,
I am also using Divi and this plugin didn’t work but I found an easy way to add the caption below the featured image. You should have a child theme set up, with the single.php file copied over from the parent Divi theme.
1. Open the single.php file from your child theme
2. Paste the following code before the closing et_post_meta_wrapper div:
<div class="et_post_meta_wrapper">
...
<?php if (get_post(get_post_thumbnail_id())->post_excerpt) { // search for if the image has caption added on it ?>
<div class="featured-image-caption">
<?php echo wp_kses_post(get_post(get_post_thumbnail_id())->post_excerpt); // displays the image caption ?>
</div>
<?php } ?>
</div> <!-- .et_post_meta_wrapper -->
3. Make sure to add your caption to the image in your media library
You can then style the caption by targeting the “featured-image-caption” class.
Hope that helps!
-
This reply was modified 6 years, 4 months ago by sidrarubel.