Archived topic
Show Hook for all sites except page1 and page2
3 replies · Started by Jonathan on July 8, 2019
Hello,
I was hoping someone could help me out with some conditional logic to display an element hook for all pages except two pages with a certain template i.e nohook.php
thanks
Jon
Hi there,
I assume the Display Rules doesn't do it?
https://docs.generatepress.com/article/hooks-element-overview/#display-rules
If not we will need this filter:
https://docs.generatepress.com/article/generate_hook_element_display/
I'm not exactly sure the conditional tag you are looking for but does this help?
https://codex.wordpress.org/Conditional_Tags
Let me know :)
Thanks. I looked at the codex and used a negative conditional statement to say show this as default if these pages don't use a certain template.
Awesome :)