While working on a website using the Astra WordPress theme for a client’s website, I was looking for a way to add captions to appear under the Featured Image in the blog post. This looks simple but for some reason, this is not a setting that can be easily switched on/off.
I found a plugin FSM Custom Featured Image Caption but the caption was still not appearing on my blog post. This took me a solid hour to figure so I’m sharing this in case someone else needs to do this for Astra theme.
You will need to install the plugin, activate the Custom Layout option in Astra, then create the layout to assign to apply to posts. Reminder this tutorial is specific to Astra Theme. Other themes may already support this plugin and works out of the box.
- First install the FSM Custom Featured Image Caption plugin and activate
- Go to the plugin page to view the documentation. This plugin has shortcode that you can place in your layout.
- Go back to your WordPress admin and go to Astra Options > Custom Layout. Click Activate.
- Under Custom Layouts, click Add New and name as Featured Image Caption.
- I’m using Gutenberg for the site. Add an HTML block and paste the short code.
- Under Custom Layout Settings, use the following settings
- Layout- Hooks
- Action – primary_content_top
- Display On – All posts
- Save the layout and that’s it!
To customize the caption and add CSS, you can add it in the plugin settings
- On your WordPress dashboard, go to Settings > FSM Custom Featured Image Caption. The default Class is enabled when the plugin is activated.
- Click Custom Style and add CSS in the box. I added a few lines to demonstrate.
- Click Save Changes and you’re done.
This is how it will look like.
To comply with non-disclosure agreement, confidential information in some case studies were omitted or obfuscated.
Are you looking for non-boring placeholder text for projects. This is my fave Jeffsum.com.