I would like to add a link to the caption of a photo in one of my posts. I can type in the HTML for the link in the caption, but when I publish the post the link gets removed.
How do you add a link to a caption? This would be really useful for giving photo credit.
See my answer on question 3097 for a possible solution.
I wanted to be able to use the media attachment’s title, description, and maybe even the permalink and image link too. I felt that a caption specific hook should be added to the
media.php
file.When I went to submit an enhancement request, it looked like someone beat me to it. Unfortunately, that was four years ago. I bumped it.
In the meantime, I published the GIC plugin to add this caption hook for me. Once the plugin is installed, you can write a filter to use more media attachment meta as your caption. With a filter, you can even add more styling or remove/hide the caption completely.
Here’s an example filter that pulls in the image’s title, caption, description, creates a download link, and adds some custom styles.
Check out the documentation and examples to see if this works for you. Shout if you have any questions.
Do you want the link under the photo, on top of the photo, or when you click the photo is goes to the caption?
Same question at wordpress support forum http://wordpress.org/support/topic/putting-a-link-in-an-image-caption .. see if these work around work for you.
Best of Luck.