Single image attachment template for custom post type gallery
-
I’ve created two custom post types ‘galleries1’ and ‘galleries2’.
This is because the website operates two different services that are styled differently. And I want to be able to use the built-in gallery function in WordPress but style the gallery differently depending on whether it’s in section ‘1’ of the website or section ‘2’.
So far I have been able to create templates as follows:
2 styles of index.php
archive-galleries1.php and archive-galleries2.php
– showing all the available galleries for that section.2 styles of single.php
single-galleries1.php and single-galleries2.php
– showing all the thumbnails within a particular galleryI’ve now hit a wall where clicking on an individual thumb to its attachment page leads to the image.php file. If I remove this it leads to the content-single.php file. What template should be used to enable me to create two styles of template for the single image attachment page? I’m not sure if this is possible as I’ve noticed I am linking to an attachment from the media library so does this mean that I can’t relate back to the fact that it was attached to a specific custom post type ‘galleries1’ or ‘galleries2’ ?
I’m not sure if I’ve explained myself well, but would appreciate any help or guidance.
- The topic ‘Single image attachment template for custom post type gallery’ is closed to new replies.