Linking to next attachment from attachment page (3 posts)

  1. thesheep
    Posted 10 years ago #

    Say I'm viewing an image on the attachment.php page.

    I want to customise that template so that there is a 'next' button that takes me to the next attachment for that same post. And have a 'previous' button that does a similar thing. So it is basically cycling through the attachments for a given post. If I have 5 images in a post, this is like a mini gallery for the post.

    I want to avoid just moving to the next attachment id number, because that might be an image from a different post.

    So I guess at the top of attachment.php I need to query the database and get a list of all the ids of attachments from the current post.

    Does this sound sensible and does anyone have any suggestions or tips on how to proceed?

  2. zaxer
    Posted 9 years ago #

    It would be great if someone answers this one, Im also interested in this functionallity

  3. rstarr
    Posted 9 years ago #

    did u find an answer for this? I am trying to figure it out myself.


Topic Closed

This topic has been closed to new replies.

About this Topic