Archived topic
Is there a way to use a hook template inside a content template in Elements?
3 replies · Started by Gary on May 23, 2022
Hi GP team,
This might be a slightly unusual request/problem I'm trying to solve. I've got a content template for a custom post type archive which I could do with hooking in another template which I've created as a custom hook template to output a popup/modal with some dynamic data.
I orginally created this for some custom query code with the custom hooks output in the PHP snippet which works well with the hook template in Elements, but I could now do with this same feature working on the post type archives too.
Is there any way I can achieve this with an elements content template and custom hooks?
Thanks
Hi there,
one way is to create a hook inside a shortcode - see here:
https://generatepress.com/forums/topic/gb-local-template-as-custom-field-or-shortcode/#post-2184779
Hi David
Thanks for this, I'll give the suggested approach a try.
You're welcome