Media attachment page – custom URI, and trying to display differing links, based on that URI

Question

I’m trying to edit the “media attachment” template.

I have four image galleries, each one with a different URI.

I want the media template to reflect the gallery in a link in the page.

The media attachment page URI is /galleries/file-name-here.
I’m trying to make this URI reflect which gallery it is under.

For example, in the “Landscapes” gallery, the URI is /gallery/landscape/.
I want to make the images in that gallery have URIs that reflect that hierarchy. So, in the case of a landscape image, I want it to be /gallery/landscape/the-landscape-image.

How would I go about doing this?

And on the media attachment page that displays the image I want there to be a link that users can click to go back to the Landscape Gallery (link to /gallery/landscape/).

How would I do this to ensure it works correctly across all four galleries?

Thanks.

0
, , , , SH10151 4 years 2020-02-15T08:39:16-05:00 0 Answers 50 views 0

Leave an answer

Browse
Browse