Title: Adding Script in Header without installing plugin
Last modified: October 7, 2016

---

# Adding Script in Header without installing plugin

 *  Resolved [manikum](https://wordpress.org/support/users/manikum/)
 * (@manikum)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/adding-script-in-header-without-installing-plugin/)
 * I am trying to put some script code in between <head> and </head> of the Virtue
   theme. One way is to use plugin ‘Header and Footer Script’. Could you tell me
   how to do it without installing plugin and doing changes in child theme of the
   plugin?

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

 *  [hannah](https://wordpress.org/support/users/hannahritner/)
 * (@hannahritner)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/adding-script-in-header-without-installing-plugin/#post-8263998)
 * Hey,
    The premium theme has a built in place for you to add this, however the
   free theme does not. You would need to use a plugin or else a child theme. Sorry!
 * Hannah
 *  Thread Starter [manikum](https://wordpress.org/support/users/manikum/)
 * (@manikum)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/adding-script-in-header-without-installing-plugin/#post-8264053)
 * I am OK on working with a child theme as I wrote in my question details. Since
   as you wrote, it is possible to do it in free version using child theme, can 
   you please tell me steps for it?
 *  [hannah](https://wordpress.org/support/users/hannahritner/)
 * (@hannahritner)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/adding-script-in-header-without-installing-plugin/#post-8264234)
 * You should be able to paste it into your header.php file. Or you can use a simple
   plugin like this- [https://wordpress.org/plugins/header-and-footer-scripts/](https://wordpress.org/plugins/header-and-footer-scripts/)
 * Hannah
 *  Thread Starter [manikum](https://wordpress.org/support/users/manikum/)
 * (@manikum)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/adding-script-in-header-without-installing-plugin/#post-8264249)
 * OK. That would help. Thanks 🙂
 *  [Ben Ritner – Kadence WP](https://wordpress.org/support/users/britner/)
 * (@britner)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/adding-script-in-header-without-installing-plugin/#post-8264257)
 * So the template is in your templates folder templates/head.php
 * But I would suggest you just add a function to pull the script into the header
   from your child theme functions.php file. like this:
 *     ```
       function custom_header_script() { 
        { ?>
         <!-- Script Starts -->
       <!-- End script -->
         <?php
         }
       }
       add_action('wp_head', 'custom_header_script', 20);
       ```
   
 * Ben
    Kadence Themes
 *  Thread Starter [manikum](https://wordpress.org/support/users/manikum/)
 * (@manikum)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/adding-script-in-header-without-installing-plugin/#post-8264270)
 * Thanks Ben! That was the exact procedure I was looking for. Could I add Boostrap
   CDN in the same way by writing it in between the script tag?

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

The topic ‘Adding Script in Header without installing plugin’ is closed to new replies.

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

## Tags

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

 * 6 replies
 * 3 participants
 * Last reply from: [manikum](https://wordpress.org/support/users/manikum/)
 * Last activity: [9 years, 6 months ago](https://wordpress.org/support/topic/adding-script-in-header-without-installing-plugin/#post-8264270)
 * Status: resolved