WordPress 3.4 comes with some new features that many users were eagerly waiting for. HTML support for Captions field in the image uploader is one such feature that many users were waiting for. Let’s take a closer look at how this can be done and why should you add HTML to captions in WordPress.
Now that you can add HTML to captions, this captions field can be used to add photo credits, licensing details or whenever you want to add formatting such as bold and italicized text. You may also want to provide hyperlink to one of your previous post and that’s where this HTML support can be useful.
How to Add HTML to Captions
Click on the Add Media button and then upload an image file. In the Caption field, add the HTML and then click on Insert into image to insert the image to the post.
Let’s say you want to add hyperlink to the caption, then you can use the below code:
<a href=”http://example.com”>Link text here</a>
Below is an example of HTML used in captions.
Same way, you can also add bold, italics, underline and other HTML code in the captions.
With the new version of WordPress, you don’t need to tweak any code or use a plugin for enabling HTML support in captions. Try out this really simple method to add captions.