WordPress.org

Forums

Editor
[resolved] Caption for featured images (2 posts)

  1. morganpotts
    Member
    Posted 1 year ago #

    Is there a way to display the captions on featured images?

  2. mindctrl
    Member
    Posted 1 year ago #

    Hey Morgan,

    That's not currently a feature of the theme. We wanted to keep it super clean and it didn't fit into the design we wanted. You could add it to your site, probably in content.php, using a child theme so you don't lose changes when you install future Editor updates.

    You'll need something like this to grab the caption from the featured image.

    <?php
    $featured_image = wp_prepare_attachment_for_js( get_post_thumbnail_id( get_the_ID() ) );
    echo $featured_image['caption'];
    ?>

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags

No tags yet.