Archived topic
Add Captions to featured Images
8 replies · Started by webcréateur on June 16, 2019
Hi there,
I am trying to display Caption for featured images.
The Best solution I found in the forum is:
https://generatepress.com/forums/topic/cant-display-featured-image-captions/#post-854633
I use Dispatch from site library with the Plugin WP Show Posts. I deactivated the Single Post Hook from Elements so that the featured image is in the Content area. And somehow the snippet above breaks all Post with a caption description.
I also tested the 2 Plugins from WP repository without success.
Could please look into that?
Best regards.
Hi there,
Any chance you can link us to a page with a broken description?
Hi Tom,
I just provided it through Account Issue:
https://generatepress.com/contact/
Thank you.
Regrads.
The simplest solution would be to hide the caption on the three different WP Show Post Styles used on the home page with this CSS:
body:not(.single) .wp-caption-text, .wpsp-align .wp-caption-text, .wpsp-card .wp-caption-text, .page-hero .wp-caption-text {
display: none;
}
Thank you very much. This works. :)
Any idea how to disable the Caption only on Archiv pages?
This CSS only works on category pages:
.category .wp-caption .wp-caption-text {
display: none;
}
The caption for featured images should only be visible on Single Posts.
Can you please help?
I updated the CSS here so it only applies to single pages.
Thank you very much. :)
You're welcome