Archived topic
Page template for Event
5 replies · Started by Siger on July 26, 2017
Hi
I want to display events on my site. I build the page with Elementor, and would like to add
when it ends. So this must be done in the GP page template, I guess.
What's the best way to do this? I use the standard page template.
Thanks
Hi there,
I think GP hooks would be the way. Check it out here:
https://docs.generatepress.com/article/hooks-overview/
http://demo.generatepress.com/hook-locations/
Let us know if this helps.
Thanks, button when I use hooks it will appear on every page, I only want it to show on pages with an event. I know I could filter on page id,but I rather woud like to choose a template. But which one do I have to modify? Or duplicate in my child theme?
You can use WordPress conditional in the hooks. I believe this is what you are looking for:
https://codex.wordpress.org/Conditional_Tags#Is_a_Page_Template
Thank for your answer Leo,
But that's not quite what I am looking for, because there are no specific conditions to filter on.. :-) So let's rephrase the question: Which template file do I have to duplicate so I can choose a different page template instead of the standard?
Thanks!
You could duplicate page.php.
There's lots of good info here: https://developer.wordpress.org/themes/template-files-section/page-template-files/