Archived topic
Header snippet in specific posts?
1 reply · Started by Marijke on May 23, 2022
Is there a way to insert header snippets only in specific posts? I'd like to display ads on blog posts ONLY. The URLs aren't website.com/blog/blog-post but simply website.com/blog-post, which makes it a little more complicated. Plug-ins that allow me to place snippets in post <head> sections also make them display in the web store products, where I don't want them.
I hoped maybe the theme would have some sort of solution for this.
Hi there,
you can use the Hook Element found in Appearance > Elements:
https://docs.generatepress.com/article/hooks-element-overview/
Add your <script> to the text area.
Set the Hook to: wp_head
Set the Display Rules to Posts > All Posts.