Adding captions to images in blog posts


#1

Hi there,

For blog posts, I would like images embedded in a blog to show image captions. Is there a way to do this?

When I add a caption on the back end, they don’t display on the front end.

Thanks!


#2

Hello,

Are you talking about featured images of posts or the images added inside the posts?

Best regards,
Artbees Support.


#3

Hi Tatyana.

Now that you mention it, I would like to be able to add captions to both the featured image and images inside a post.

Thanks!


#4

Hello,

We need to check your settings.
Please create a ticket https://themes.artbees.net/new-ticket and provide WP Dashboard credentials.

Thank you.
Best regards,
Artbees Support.


#5

To add the caption area for featured image you need to edit the file blog-single-meta.php
I use jupiter child theme so I made the same folders to put the blog-single-meta.php file
in jupiter-child theme folder I add these folders views > blog > components
in components folder I copied the blog-single-meta.php file from jupiter theme folder

After these lines in blog-single-meta.php

$image_src_array = wp_get_attachment_image_src(get_post_thumbnail_id() , ‘full’);

I added these lines

/* Featured Image Caption
*/
$get_description = get_post(get_post_thumbnail_id())->post_excerpt;
if(!empty($get_description)){//If description is not empty show the div
echo’’ . $get_description . ‘’;
}

Hope this helps