Users of WordPress 2.6 will know that you can insert captions underneath photos and images within your posts. If any of you have tried to add hyperlinks within a caption, you’ll also know that WordPress will strip that link faster than a suspected terrorist at LAX when you hit save.
Now, I’m not techy enough to know exactly why WordPress strips links from captions but it does. I do know that with some fiddling about, I finally found a fairly straight forward workaround that doesn’t involve custom fields or plugins.
My situation might be a little different. I wanted to actually have a secondary caption of sorts to use as a photo credit and have a caption for the photo.
What seems to work for hyperlinking text within WordPress captions is nesting the link within small tags before the end of the WordPress caption tag, like this:
I’m not sure why this technique of using small tags does the trick. As you can see from the picture above, it does work.
Once you’ve got your small tag in there, you’ll need some CSS if you want to position that tag somewhere special. I wanted it off to the left so that it would be a photo credit, visually separate from the caption but still within the WordPress caption tags. The CSS I used for positioning is as follows:PGNvZGU+DQojY29udGVudCBzbWFsbCB7DQoJZm9udC1zaXplOiAwLjdlbTsNCgljb2xvcjogIzc1NzU3NTsNCglmbG9hdDogbGVmdDsNCn0NCjwvY29kZT4=
Hope this works for you and if you have another, preferably easier or sound workaround for this issue, lets hear it.
- Inserting SPAN into WordPress categories using wp_list_categories
- Custom Page Templates Not Showing Up in WordPress
- WordPress Baby Themes
- Switching between WordPress Visual and HTML editor not working
- Working on retainer