Title: Add script
Last modified: September 14, 2021

---

# Add script

 *  Anonymous User
 * (@anonymized-18703045)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/add-script/)
 * Hello,
 * How can I add a script in the header of a certain landing page?

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [Leo](https://wordpress.org/support/users/leohsiang/)
 * (@leohsiang)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/add-script/#post-14871704)
 * Hi there,
 * You will need to use a hook:
    [https://docs.generatepress.com/article/using-hooks/](https://docs.generatepress.com/article/using-hooks/)
 * With a conditional tag:
    [https://codex.wordpress.org/Conditional_Tags](https://codex.wordpress.org/Conditional_Tags)
 * The wp_head hook should be what you are looking for:
    [https://docs.generatepress.com/article/wp-head/](https://docs.generatepress.com/article/wp-head/)
 * It’s a WP core hook so you can see some more examples here:
    [https://developer.wordpress.org/reference/hooks/wp_head/](https://developer.wordpress.org/reference/hooks/wp_head/)
 *  Thread Starter Anonymous User
 * (@anonymized-18703045)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/add-script/#post-14871861)
 * Hello, I think it’s too difficult for me.
 * I use Elementor, could that be a solution? I mean, add the html widget wherever
   in the page, paste the script and save.
 * ¿?
 * Best regards,
 *  [Leo](https://wordpress.org/support/users/leohsiang/)
 * (@leohsiang)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/add-script/#post-14871940)
 * This would be unrelated to Elementor.
 * If the code is to be added in the <head> area then you would need to use the `
   wp_head` hook.
 * The Hooks element in GP Premium would make this very easy;
    [https://docs.generatepress.com/article/hooks-element-overview/](https://docs.generatepress.com/article/hooks-element-overview/)
 * If not then here are a couple of examples of using the function:
    [https://wordpress.org/support/topic/add-code-in-category-head/#post-13198148](https://wordpress.org/support/topic/add-code-in-category-head/#post-13198148)
   [https://wordpress.org/support/topic/generatepress-i-want-to-add-my-own-code-to-the-header/](https://wordpress.org/support/topic/generatepress-i-want-to-add-my-own-code-to-the-header/)
 * Hope this helps 🙂
 *  Thread Starter Anonymous User
 * (@anonymized-18703045)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/add-script/#post-14873772)
 * Hi,
 * I don’t have GP premium so I can not do that.
 * Thanks for the examples but I don’t have skills to do that either. This is “adding
   php”?
 * Should I follow this document? [https://docs.generatepress.com/article/adding-php/](https://docs.generatepress.com/article/adding-php/)
 *  [Leo](https://wordpress.org/support/users/leohsiang/)
 * (@leohsiang)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/add-script/#post-14875685)
 * Yes – the Adding PHP article shows you ways of adding functions to your site.
 * Using the Code Snippets plugin is the easiest method unless you are using a child
   theme already 🙂

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Add script’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/generatepress/3.6.1/screenshot.
   png)
 * GeneratePress
 * [Support Threads](https://wordpress.org/support/theme/generatepress/)
 * [Active Topics](https://wordpress.org/support/theme/generatepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/generatepress/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/generatepress/reviews/)

## Tags

 * [script](https://wordpress.org/support/topic-tag/script/)

 * 5 replies
 * 2 participants
 * Last reply from: [Leo](https://wordpress.org/support/users/leohsiang/)
 * Last activity: [4 years, 8 months ago](https://wordpress.org/support/topic/add-script/#post-14875685)
 * Status: not resolved