I recently recently launched a new WordPress plugin for Google's Universal Analytics. Check it out!.
Close

Get the image caption in WordPress

Get the image caption in WordPress

In the last 4 years I can count on one hand how many times I have needed to use the image caption or description.  What’s crazy is that three of them have been in the last two months.  When trying to search for the answer I was amazed at how difficult is was to find what I needed.  It turns out it’s pretty simple.

There’s no fancy “get_image_caption”. That would be too easy right?

First I had to learn that there’s no fancy “get_the_image_caption”.  That would be too easy right?  Anyway, an image (or attachment) is treated like a post therefore you have an excerpt and the content.  The excerpt is equal to the caption and content equals the description

Read more...