This quesiton has been asked several times by many people in the WP forums but nobody seems to have ever come up with a viable solution.
With a native WP generated thumbnail gallery, the default thumbnail link is to the larger image. How do I link that thumbnail to the address that I type into the Link URL field when adding the image?
Any suggestions appreciated as I’ve made a client list gallery of logos that I’d love to link out to the client sites and don’t want to hardcode in the gallery as I need other people to be able to easily update it.
well, to link to the Link URl of the attachment you should add the link attribute:
But, I don’t think you can change the link url to an external site… if you change it it get reverted to the original image URl.
I guess you need to recode the gallery shortcode for this…
I write this post from my phone. So, sorry if I can’t include some links for references. But, you can get help from Mr.Google
First, Link URL field in attachment edit page is there to help you insert picture (with link) to your post easily. So, it will not be saved in database. If you want to add Custom Link URL , you can use Google to find about “how to add custom attachment meta to your attachment”. Yes, attachment is a custom post type, so you can add custom field to attachment, but it is different with other post types.
Second, you need to hook wordpress gallery shortcode to enable this external link feature. You can learn from Cleaner Gallery plugin by Justin Tadlock.
Thanks for the responses – I hoped it might be a quick fix :> I’ll get investigating!
check this one, it is perfect for your,http://geekeemedia.com/wordpress/add-a-custom-url-to-your-wordpress-gallery-images/
Fantastic, thank you very much indeed – I shall give that a go,
That code works perfectly! Thanks again!