Is there a way to display the image caption where ever available when displaying the_post_thumbnail()
image in WordPress on the posts in the primary loop.
Thanks! Appreciate all the help.
Is there a way to display the image caption where ever available when displaying the_post_thumbnail()
image in WordPress on the posts in the primary loop.
Thanks! Appreciate all the help.
You must be logged in to post a comment.
Here is an easier and shorter code :
As of WordPress 4.6, the function
the_post_thumbnail_caption()
has been added to core (/wp-includes/post-thumbnail-template.php).Using the code posted here will cause the error:
I figured it out: