free tuts

Image inside post has a caption and added automatically if we fill in the required field int Media Library once we use an image or gallery for the post. Featured image, however, requires manual adding of a small piece of code inside theme file. Place it in any template file where you want a caption to appear under featured image, for example index.php. Add in functions.php this function:

And in template file this piece of code:

Full code inside post or page file:

It is recommended to prefix the function with your name or theme name (yourname_get_post_thumbnail_caption).

Limpopo

©2014-2018