Support » Fixing WordPress » Gallery images link to attachment_id instead of image url…

  • Resolved Joshuwar


    Hi, thanks for reading.

    I’ve been using gallery shortcodes wired directly into single post template files for a while now, with no issues whatsoever. (eg.

    So it surprised me recently as I was building a new site with this technique, to find that instead of linking to the image file, gallery thumbnails were automatically linking to an attachment id, for example:

    instead of

    This means that there’s another page to click through to get to the full size (or lightboxed, in this case) image.

    I’ve no idea why this has started happening, I’m using clean installs of 2.8.5, no plugins for testing, and have created the theme from scratch (so there are no weird behaviours I’m unacquainted with).

    I’ve tried setting the image URL in the media manager for a post to ‘file url’ but this makes no difference.

    Probably I’m missing something embarrassingly obvious, but it’s annoying, so if anybody has any ideas of what could be doing this, or has experienced the same problems, I’d be real happy for y’all insights.



Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    I have been using Next Gen Gallery plugin for ages, but just today I decided to have a go at using the WordPress Gallery shortcode instead. So far, so interestingly good, still getting my way around it.

    This page is useful:

    And right at the bottom it mentions the link option in the gallery shortcode. Like this:
    [gallery link="file"]
    This makes the thumbnail link to the image file rather than the attachment’s file (which is the default).

    I have just tried it and it seems to work. Hope this is helpful.


    This is the page link, which it didn’t include in the previous post.

    Hi! Sorry about the delay- That’s got it, absolutely.


Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Gallery images link to attachment_id instead of image url…’ is closed to new replies.