Support » Fixing WordPress » The [gallery] default link appears to be the image file, not the post

  • I created a gallery on a page that includes all the images from a different post. I want the visitor to visit the original post when they click on an image or better yet, visit the link chosen with the image in the media gallery.
    [gallery id="5595" col="3" size="medium" orderby="title" order="ASC link="attachment"]
    This works great but when I click on an image I only get the image file, not the original post. According to the codex:

    [gallery itemtag="div" icontag="span" captiontag="p" link="file"]

    link
    you can set it to “file” so each image will link to the image file. The default value links to the attachment’s permalink.

    When I change link=”attachment” to link=”file” I do get a better, cleaner view of the original image. I see a larger image on a black field.

    How can I make the click follow the link set up with each image when the image appears in a gallery on a different post? Is there a setting somewhere I’ve overlooked?

Viewing 4 replies - 1 through 4 (of 4 total)
  • esmi

    (@esmi)

    Forum Moderator

    When inserting a gallery into its own Post or Page, you can select whether to link to an attachment page or the original image file. If you entering the gallery shortcode manually because you want a custom gallery, you will still need to add the link="file" attribute to the shortcode.

    From the code above you can see that I did that AND I took it out to see if it would return to the default. It did not. I get a link to the image file no matter what I do I cannot get it to go to the original blog post.

    Because I am showing a gallery using images from another post I had to do a custom gallery, right? I just want the viewer to go to the original post, or preferably to the designated link I chose when I uploaded the image.

    Is this even possible?

    esmi

    (@esmi)

    Forum Moderator

    When I change link=”attachment” to link=”file” I do get a better, cleaner view of the original image. I see a larger image on a black field.

    Is that not the original image file?

    With link=”attachment” or link=”file” I get the same information, just displayed in a slightly different way – the original image.

    It made sense to me that since there was a field there with the image I could put what I wanted, but it only goes to the image file, nowhere else.

    Found a plug-in but it is not in the repository. No time to do dangerous (and possibly time consuming) testing right now. I’ll have to shelve this problem until later.

    Has anyone tried this plugin?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘The [gallery] default link appears to be the image file, not the post’ is closed to new replies.