Support » Fixing WordPress » 2.5: “attachment” in permalink for single image subpost of gallery

  • I really like the built in gallery option in 2.5. I have noticed one issue though. Well…two, but this post is about one specifically. When viewing a single image (the subpost) in an image gallery, the permalink adds “attachment” to the url, sort of like this: This apparently only happens if you have the category in the permalink structure. That is when I remove /%category%/, “attachment” also disappears. Is this a feature or a bug? Is there anyway I can have the “attachment” removed from the permalink without removing the category?

    Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • probably a feature. There is, more than likely, a hidden category that all single images are added to (to differentiate them as single images), and that would be why there is a /category/ section in your permalink.

    I’m just wondering why removing the /%category%/ from the permalink structure would also remove the attachment part of the permalink. It seems like it would make it less likely to differentiate them as single images. I hope that made sense.

    Has this ever been resolved? When I upload media, half of my images in the gallery are appearing with the /attachment/ in the permalink and therefore showing up with a comment box down below. When I go to Manage Posts, the photos don’t appear there (even though it looks like a post and says “Posted in Uncategorized”). Please help!

    It appears that if an image file-name is_numeric() that it displayed as an attachment. I was helping CelestialGraffiti troubleshoot with the issue described above, and we together came to this conclusion.

    If an image file-name starts with an alpha character, the URL will not include the attachment. Due to the nature of this, it appears to be a bug, and I have opened a trac ticket at the url below:

    Temporary Fix: Don’t use purely numeric names as photo file-names. Append/Prepend Alpha characters too them (ie: img_ or ‘my_kitty’), and the files will display properly in the permalinks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘2.5: “attachment” in permalink for single image subpost of gallery’ is closed to new replies.