I'm trying to set up non-conventional image galleries for a photography website using taxonomy pages instead of traditional pages which employ the [gallery] shortcode.
The taxonomy ("image-gallery") is hierarchical and is associated with the "attachment" post type. Categories within the "image-gallery" tax allow for multiple galleries (e.g. Desert Landscapes, Rivers and Streams, Portraiture, etc.). All gallery organization can take place from within the media library instead of having to create a [gallery] from within a "page." The client can simply check the box of the appropriate taxonomy to which the image belongs. Sorting of images is done via "Menu Order."
As such, images are not "attached" to posts as galleries usually behave, nor do they have a "post_parent," but are defined only by the taxonomy to which they belong.
To display a gallery, the template "taxonomy-image-gallery.php" displays thumbnails of all images assigned to the gallery and links to the attachment page, in this case, image.php. I use menu_order to sort thumbnails, and this all works great. I use an attachment page as I can include additional information contained in custom fields (e.g. location, pricing, available print sizes, etc.). But here's where I get into issues:
On the attachment page, I would like to have "previous" and "next" navigation to other images of the gallery using "menu_order" as the sequence that should be followed. The first image should not have a "previous" link, nor should the last have a "next" link.
Attempts to modify or customize the next_image_link() or plugins like "Ambrosite Next/Previous Post Link Plus" return funky results, probably due to my incompetence. The best I can make out, some sort of tax query is needed to identify the previous or next image, and my PHP just isn't strong enough to manage this. Is this a futile exercise, or is there some way for this to work? Many thanks in advance..