WordPress.org

Ready to get started?Download WordPress

Forums

2.5: "attachment" in permalink for single image subpost of gallery (5 posts)

  1. mcdlt
    Member
    Posted 6 years ago #

    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: hello.com/gallery/2008/04/attachment/dsc-1234/. 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!

  2. nathanrice
    Member
    Posted 6 years ago #

    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.

  3. mcdlt
    Member
    Posted 6 years ago #

    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.

  4. CelestialGraffiti
    Member
    Posted 6 years ago #

    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!

  5. na3s
    Member
    Posted 6 years ago #

    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:

    http://trac.wordpress.org/ticket/7210

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic