Archived topic
How to stop GP Hook (After Content) showing in categories?
3 replies · Started by RJ on August 12, 2018
When I insert code into 'After Content' as a GP hook, it displays fine for each post.
However, it also displays in my category archives. See image > https://www.screencast.com/t/bVPryWcQVZh
Can you please tell me how to stop this from happening. Thanks. (For the time being, I have disabled the hook.)
Also... is it possible to exclude the hook on certain posts?
TIA
Robin
Hi there,
This page should offer some info:
https://docs.generatepress.com/article/using-hooks-conditional-tags/
However I would recommend waiting for GP Premium 1.7 to be released tomorrow so you can use the new Hooks Element module with the powerful display rule so you don't have to write any PHP:
https://docs.generatepress.com/article/hooks-element-overview/
https://docs.generatepress.com/article/hooks-element-overview/#display-rules
You can get it now by becoming a beta tester:
https://docs.generatepress.com/article/beta-testing/
Cheers Leo - I'll wait for the official release.
Robin
It's been delayed by a day. Should be out tomorrow :)