347 posts
  • Bought between 100 and 499 items
  • Has been a member for 5-6 years
  • 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
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Exclusive Author
  • Interviewed on the Envato Notes blog
  • Beta Tester
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
+4 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
  • Bought between 10 and 49 items
  • Elite Author
  • Exclusive Author
  • Has been a member for 3-4 years
  • Referred between 10 and 49 users
  • Sold between 250 000 and 1 000 000 dollars
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.

347 posts
  • Bought between 100 and 499 items
  • Has been a member for 5-6 years
  • United Kingdom
kops says

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

147 posts
  • Bought between 10 and 49 items
  • Elite Author
  • Exclusive Author
  • Has been a member for 3-4 years
  • Referred between 10 and 49 users
  • Sold between 250 000 and 1 000 000 dollars
FlexiPress says
347 posts
  • Bought between 100 and 499 items
  • Has been a member for 5-6 years
  • United Kingdom
kops says

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

J

347 posts
  • Bought between 100 and 499 items
  • Has been a member for 5-6 years
  • United Kingdom
kops says

That code works perfectly! Thanks again!

1 post
  • Bought between 1 and 9 items
  • Has been a member for 1-2 years
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