How to Display Caption Under Featured Image in WordPress
Featured image is one of the most important parts of a blog post. If you want to display captions under featured images, you came to the right place. Adding captions to featured images is so simple.
Displaying a caption under a featured image isn’t a fact for your SEO though some bloggers want to show captions under featured images. If you are one of them and looking to display featured image caption in WordPress, you won’t need to change the code or modify any hard part of your WordPress website. Some themes automatically show caption under the featured image. But, If your theme isn’t showing thumbnail caption, then don’t worry. I will share 2 methods to add captions to featured/thumbnail images.
You can add featured image caption with a plugin or adding a simple code to your functions.php file.
Also Read: 31 best WordPress themes for travel blogs
Add Caption Under Featured Image in WordPress with Plugin
Method 1:
For adding featured image caption through a plugin, you need to install the Featured Image Caption plugin. It’s a free plugin.
As you see in the screenshot, this plugin has a good number of installations. (5000+). Don’t worry about the “Last updated” options. This featured image caption plugin works fine in every theme.
However, After installing the theme, you will get a new featured image caption option in your sidebar.
Simply write down the caption “Caption Text” box. In addition, you can also add the source and source link of the picture in the “Source Attribution” field.
You can also choose where to display the caption in the plugin settings option.
Add WordPress Featured Image Caption With A Code
Method 2:
You don’t need to have any coding skills to go through with this process. You can simply display the featured image caption by adding this simple code to your theme’s functions.php file.
function the_post_thumbnail_caption() { global $post; $thumbnail_id = get_post_thumbnail_id($post->ID); $thumbnail_image = get_posts(array('p' => $thumbnail_id, 'post_type' => 'attachment')); if ($thumbnail_image && isset($thumbnail_image[0])) { echo '<span>'.$thumbnail_image[0]->post_excerpt.'</span>'; } }
Add this code to your theme’s single.php or, index.php to display featured image caption
<? the_post_thumbnail_caption(); ?>
Now, you are all set up!
What Is The Featured Image In WordPress
A featured image in WordPress is a primary image that represents a blog post or page. It is typically displayed at the top of the post or page, and it is also used when the post or page is shared on social media. Featured images can help to make your website more visually appealing and engaging, and they can also help to improve your website’s SEO.
Conclusion:
Displaying the caption in the featured image doesn’t change your Website traffic. Personally, I don’t use caption in my featured images. However, if you wish to add captions to featured images, the above 2 methods will help you do so.
If you face further problems for displaying the featured image caption on your WordPress website or these methods aren’t working for your current theme, then let me know in the comment section. I will surely reply.
Share This Post:
Cyber Monday’s Best WordPress Themes, Plugins & Hosting Deals For Bloggers
Best Amazon Cyber Monday Tech Deals 2023: Save Big on Your Favorite Gadgets!
Subscribe to Our Newsletter
Get Our Exclusive Tutorials, Recommendations and more for FREE!
Pingback: How to Disable Comments in WordPress (Easy Methods) - Tech Battler