- This topic has 6 replies, 2 voices, and was last updated 4 years, 5 months ago by David.
-
AuthorPosts
-
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 SupportHi there,
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:
https://gist.github.com/diggeddy/e487553c6b5749728957dad36393db4cThis 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 #1048283Robinwow! excellent! thank you very much!
October 29, 2019 at 4:32 pm #1048292DavidStaffCustomer SupportYou’re welcome – i left some comments so you can at least see what is what and can compare it to the single.php its built off of.
October 29, 2019 at 4:52 pm #1048308Robinyes, 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 #1049252RobinJust 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.
Robin
October 31, 2019 at 5:17 am #1049502DavidStaffCustomer SupportYou’re very welcome – happy to be of help
-
AuthorPosts
- You must be logged in to reply to this topic.