Hi @vdn-staff,
You can limit loading of the code just on the homepage by adding a new snippet and creating a simple Conditional Logic rule to only load that snippet on the homepage.
The same is possible for posts/pages using the Post Type conditions. You can find more info about conditional logic options in this article: https://wpcode.com/docs/how-to-use-snippets-smart-conditional-logic/
Regarding adding code to the header, using the Site Wide Header location (the default for custom snippets) will add it in the same place as the Header & Footer “Header” area.
Got it!!!
But unfortunately, since Site Wide Header is the only option I see at the moment for adding codes to the header, I see that the codes are still added to the header site wide after adding Conditional Logic rules…
Hi @vdn-staff,
I’m not sure what you mean but you should first make sure that all the codes are moved from the Global Header & Footer area to the newly created snippets.
@gripgrip
“…you should first make sure that all the codes are moved from the Global Header & Footer area to the newly created snippets.“
I tried that and this…
“…I see that the codes are still added to the header site wide after adding Conditional Logic rules…“
…was the result, unless there’s something I didn’t do… 🤔