- This topic has 6 replies, 2 voices, and was last updated 2 years, 1 month ago by David.
October 29, 2019 at 10:15 am #1048019Robin
Hello! I am still working on setting up a custom layout to be displayed when a visitor clicks on a thumbnail in one of the multiple galleries there will be on the website. Some of those galleries will have a lightbox feature, but others won’t. For the galleries that don’t use a lightbox, I want to customize the page that appears when a visitor clicks a thumbnail image.
1. there will be a special menu for that page, with the same styling and location as the regular navigation, but with only two links
2. the page layout (the attachment page is technically a post, correct? so I will restyle that page in the child theme, as “attachment.php”? is that correct, or will using a hook and element be enough?
3. layout very simple: no footer, special menu as above, image at large size, with image meta data underneath: caption OR title (I am making those the same in the media library) AND description.
4. Using a hook to set up that element, what is that hook? wp_attachment_image?? or?
5. I have been researching customizing the image-attachment page, and there are things about php I don’t understand. I know that I need to fetch the actual image that the thumbnail clicked on represents, fetch the meta data for that image, and then display all that in html form…
Your assistance and advice much appreciated!
Apologies for my newbie-ness. I do retain what I learn, and repeat those lessons until I no longer need assistance at that level.
Thank you!October 29, 2019 at 3:59 pm #1048270DavidStaffCustomer Support
this is out of usual scope, but in this instance i thought it easier to provide a basic attachment.php template that you can install in your child theme to get you started.
The file can be found here:
This will output the Attachment image full size, followed by Title and Description.
Its built on the standard page template so things like sidebars and footer are still present.
Thought it better they remain in the template for future scope. You can remove them using the Layout Element with a Display Rule of Media > All Media.
For the different navigation i would recommend using the Secondary Navigation for your two links. Again you can use the Layout Element to remove the navs accordingly.October 29, 2019 at 4:19 pm #1048283Robin
wow! excellent! thank you very much!October 29, 2019 at 4:32 pm #1048292DavidStaffCustomer SupportOctober 29, 2019 at 4:52 pm #1048308Robin
yes, those are most helpful.
have added /draggable=”false”/ to img as first foray into working with the template.October 30, 2019 at 5:16 pm #1049252Robin
Just wanted to say THANK YOU again. From what you provided, I have been able to do EVERYTHING on my wish list for the single-image pages.
Lots still to do on fine tuning and debugging of the website etc etc but: the basics are set, and I will continue learning from that template.
So very much appreciated.
RobinOctober 31, 2019 at 5:17 am #1049502
- You must be logged in to reply to this topic.