Support » Fixing WordPress » caption in featured image

  • I don’t know how to display a caption in a featured image, namely make it available for the reader when he/she enter in the post. I have already checked the options available in “Edit image” but without success. Please advise!

Viewing 1 replies (of 1 total)
  • The display is usually going to depend on your theme, so you will need to get your hands dirty with some PHP if you want to change the display. Typically your single post template will be single.php and you can grab the featured image caption while inside the loop using something like

    echo get_post(get_post_thumbnail_id())->post_excerpt;

    If you plan to update the single post template, make sure to create a child theme before making changes to your theme code so you don’t lose everything when updating.

Viewing 1 replies (of 1 total)
  • The topic ‘caption in featured image’ is closed to new replies.