This tutorial provides 2 of the easiest and most efficient ways to add a custom link to any featured image.
The 1st custom function can simply be pasted in your child themes functions file. No need to edit parent theme files which are lost after theme updates.
By default, featured images link back to the post permalink however this solution makes changing that, very simple.
Here’s the demo video which shows you what this solution does:
On top of determining the URL your images link to, the code also enables you to very easily:
- Set the image size
- Determine the position of the image
- Add a custom class for the image
- Custom linking of featured images on single posts & default linking of archive thumbnails to single post permalinks ( This is the default )
- Link both archive thumbnails & single post featured images to custom URL’s
All you need to do is paste the URL into a field and press save.
The 1st solution works in genesis and the 2nd in non genesis themes.
Here’s both code snippets: