WordPress.org

Forums

Linking to next attachment from attachment page (3 posts)

  1. thesheep
    Member
    Posted 8 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
    Member
    Posted 8 years ago #

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

  3. rstarr
    Member
    Posted 8 years ago #

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

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic