WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Attachment.php doesn't seem to work. (3 posts)

  1. Robinj
    Member
    Posted 6 years ago #

    I've been uploading images and putting them into posts with the link option set to "page". I have uploaded attachment.php from the default theme into my theme clicking on the image should load a page with attachment.php template.
    This doesn't seem to work, clicking an image simply takes you back to the index.php template. The link the image takes you to is /category/post-title/image-title/ (obviously with the relevant category, post title etc. in the link). Does anyone know why this might be happening or any workarounds to display the images in a page rather than on their own as files (I need them in a page to show licensing info and such)

  2. moshu
    Member
    Posted 6 years ago #

    Using %category% in the permalink structure can be tricky...
    Did you try changing your permalink structure?
    (N.B. I tested on a local install and it didn't work with your permalink structure, however, it worked well with other settings...)
    Maybe it is worth to give it a try.

  3. Robinj
    Member
    Posted 6 years ago #

    Hey, that works. The permalinks are now set to just /post-title/image-title/ and it all loads up fine. On reflection I should be able to leave permalinks as it to keep categorised permalinks, and just change the links manually when I add images.

    Thanks a lot!

    Guess that's a bug of sorts for someone to have fun with...

Topic Closed

This topic has been closed to new replies.

About this Topic