Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

23
  • tested and works? btw: inside array_navigate() you could grab the index via array_values(), which should be slightly faster than flipping it. Commented Feb 3, 2013 at 4:00
  • 1. show_all_thumbs always shows the same thumbnails, no matter which thumbnails are in the post. 2. How do you prevent it from being an endless loop? That is, how would I make sure the last image does not have a "next" link on it? Commented Feb 3, 2013 at 18:57
  • The show thumbs bit shows all the images in the gallery, so it will always be the same. It's a form of quick navigation ( and also an optional one that is a side bonus, but not necessary to answer this question ) Commented Feb 4, 2013 at 9:07
  • And yes, this is from a theme I had that I never released. To prevent the looping, you would need to modify array_navigate to return false rather than call end/current. You'd then ened to check for that false in previous_attachment_ID and next_attachment_ID. However doing that is beyond the scope of your question Commented Feb 4, 2013 at 9:11
  • In that case, your answer did not address my original question - as it does not allow the normal gallery display to only show images in the current gallery. The traditional gallery insert still loops through images which are not in the post. Commented Feb 4, 2013 at 15:10