Display Image Caption Under Featured Images In WordPress

WordPress lets you add the image caption and its description per images uploaded in your site. So, if you are building up the WordPress theme or news site, then, probably you may want to display image caption under the featured images of your site, isn’t it? Well, so you searched for the same and landed on this very page, hence you are in total luck on this. Here, we will describe about how to display image caption under the featured images of your posts.

What is image caption?

Well, the answer to this is, it is just the small bit of information about what the image is for. Also, the main advantage of this in WordPress sites is, it can be utilized to display about the image license in the WordPress posts, which is especially greatly helpful for the news/magazine sites.

Also, just lets us say that, you have an important image added in your site and hence want to display about where it is taken, right? Well, you too can utilize this image caption feature to display about this important event taken place too in your site.

How to display image caption in WordPress under featured images?

Now, since you already learned about what is image caption and when is it useful, now you may want to display it in your site under the featured image to give the credit to the person who helped you click that image right? Well, then why the wait. So, let’s us move ahead and display image caption under the featured image of your posts.

For the display of the image caption under the featured image, you first have to know that which file is rendering the display of the featured image in your site. Now, after knowing that, you can open up that file and paste the below PHP code under the featured image to display image caption of that image:

Here, below is the screenshot about the addition of the caption in the uploaded image in your WordPress site:

Here, above you can see that the Caption text is being added for that image. Now, if you have already added that above provided PHP code in your required file, then, you will probably see the output of this something like below:

Now, if you see the same output as the above, then, we can say that you are able to display the image caption under the featured images of the posts. But, you might not notice the same design as in our output since no CSS is being applied to it. Hence, it will display the output as the plain text. So, to add little bit of styling for your site, you can add the below CSS code in your style.css file of the theme:

Conclusion

Well, if you have followed up the above tutorial properly and is successful on displaying the image caption under the featured image of your posts, then, we can say that you are now able to display image caption under the featured images in your site better than before. But, if you are still confused and want to know more on this, then, drop the comment below in the comment box and we will follow it up.

, , , , , , , , , , , , , , , , , , , , ,

Post navigation

Bishal Napit

Bishal Napit is a WordPress theme developer from Tansen, Palpa, with a passion to learn more on WordPress.

Leave a Reply