359 posts
  • Has been part of the Envato Community for over 5 years
  • Has collected 100+ items on Envato Market
  • Located in United Kingdom
kops says

Hi folks,

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.

Thanks!

Jonny.

3256 posts
  • Has referred 100+ members
  • Has sold $250,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+9 more
ParkerAndKent says

Hi,

well, to link to the Link URl of the attachment you should add the link attribute:

[gallery link=”file”]

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…

Parker

147 posts
  • Has been part of the Envato Community for over 3 years
  • Has referred 10+ members
  • Has sold $250,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+2 more
FlexiPress says

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 :-D

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.

359 posts
  • Has been part of the Envato Community for over 5 years
  • Has collected 100+ items on Envato Market
  • Located in United Kingdom
kops says

Thanks for the responses – I hoped it might be a quick fix :> I’ll get investigating!

147 posts
  • Has been part of the Envato Community for over 3 years
  • Has referred 10+ members
  • Has sold $250,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+2 more
FlexiPress says
359 posts
  • Has been part of the Envato Community for over 5 years
  • Has collected 100+ items on Envato Market
  • Located in United Kingdom
kops says

Fantastic, thank you very much indeed – I shall give that a go,

J

359 posts
  • Has been part of the Envato Community for over 5 years
  • Has collected 100+ items on Envato Market
  • Located in United Kingdom
kops says

That code works perfectly! Thanks again!

1 post
  • Has been part of the Envato Community for over 2 years
  • Has collected 1+ items on Envato Market
N-atadistance says

I am using TWO FOLIO and I can’t seem to make this plugin work. Any help much appreciated.

Thanks,

Nick

by
by
by
by
by
by