Site logo

Archived topic

Adding a Javascript script

3 replies · Started by vasu on January 16, 2023

Viewing posts 1–4 of 4

Hi!

Can I add a Javascript script to Code Snippets and will it work if I do? It's a script I have to install globally in the header. Thanks!

Hi there,

you can use a GP Hook Element:

https://docs.generatepress.com/article/hooks-element-overview/

1. Go to Appearance > GeneratePress and activate the Elements module.
2. Go to Appearance > Elements -> Add New --> Hook Element.
3. Add your <script> in the text area
4. Set the Hook to wp_head
5. Set the Display Rules -> Location to Entire Site

Thank you!

You're welcome

This archived topic is closed to new replies.