At the end of your functions.php template file add this code:
Where ever you want to display the caption of the featured image just use the function “the_post_thumbnail_caption()”. See below for an example.
*Please note the 3rd line should really be just a continuation of the 2nd line with a space between the “ and the height=… *
Dan Bernardic says
Hi Jared,
Good way of doing that. A template tag, or basically a “helper function” in the more generic terms.
I see a lot of functions with a similar functionality adding $before and $after parameters, so that the user gets to pick what tag wraps the data.
Thanks for sharing this on the WordPress Winnipeg LinkedIn group.