Site logo

Archived topic

adding an image's caption below a post's featured image

7 replies · Started by Allen on February 19, 2022

Viewing posts 1–8 of 8

What is the easiest way to have the caption appear below a feature image on a single post? Thanks!

The primary reason I chose Generate Press was to keep the code super light. If I have to add plugins to get basic functionality, that benefit gets lost.

Tossing snippets in is reasonable.

I found this post in the forum before posting my question, but wasn't sure about it. The code looks different/cleaner from #2 above:
https://generatepress.com/forums/topic/add-featured-image-caption-via-elements/#post-1757071

Do you know if these two bring the same result? Guess I could test them both...

Glad it works.

I have added the referenced PHP code snippet and CSS to add captions to all of my featured images. Works great! However, I am having one very minor issue. On my Archives home page, there is padding between the featured image and caption text. However, for the individual posts, there is no padding between the featured image and caption text.

You can see this at my site.

Is there an easy way to add the padding for individual posts? If not, I can live with how it works now.

Never mind. I found my issue in my Simple CSS snippet. I was trying to add a comment with "//". I deleted my "comment" lines, and now it's working correctly.

Glad to hear :)

This archived topic is closed to new replies.