Site logo

[Resolved] adding an image’s caption below a post’s featured image

Home Forums Support [Resolved] adding an image’s caption below a post’s featured image

Home Forums Support adding an image’s caption below a post’s featured image

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #2125704
    Allen

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

    #2125761
    Ying
    Staff
    Customer Support

    Hi Allen,

    The easiest way would be using a plugin, this article explained how:
    https://www.wpbeginner.com/wp-tutorials/how-to-display-wordpress-post-thumbnails-with-captions/

    The not so easy way that you can try is this solution David provided here 🙂
    https://generatepress.com/forums/topic/cant-display-featured-image-captions/#post-854633

    #2125820
    Allen

    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…

    #2125833
    Allen

    Just tested https://generatepress.com/forums/topic/add-featured-image-caption-via-elements/#post-1757071

    Worked well, but for me the css had to be .wp-caption (no .featured-image in front).

    #2126612
    Ying
    Staff
    Customer Support

    Glad it works.

    #2318667
    George

    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.

    #2318689
    George

    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.

    #2319265
    Leo
    Staff
    Customer Support

    Glad to hear 🙂

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘adding an image’s caption below a post’s featured image’ is closed to new replies.