Featured Image Links and Captions

WordPress makes no obvious provision to add links or captions to your featured images. Fortunately it turns out to be quite simple. Here’s the thumbnail code that I use: