Title: Code in the HEAD section
Last modified: August 21, 2016

---

# Code in the HEAD section

 *  [rosuna](https://wordpress.org/support/users/rosuna/)
 * (@rosuna)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/code-in-the-head-section/)
 * I need to insert one line of code in the HEAD section. This one:
 * `<script type='text/javascript' src='http://ads.redcoruna.com/delivery/spcjs.
   php?id=50'></script>`
 * Is it possible to do it using the child theme I have created?
 * Thanks.

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

 *  [tomaja](https://wordpress.org/support/users/tomaja/)
 * (@tomaja)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/code-in-the-head-section/#post-4379842)
 * maybe this will help
 *     ```
       function custom_js() {
           echo '<script type="text/javascript" src="http://ads.redcoruna.com/delivery/spcjs.php?id=50"></script>';
       }
       add_action('admin_head', 'custom_js');
       add_action('wp_head', 'custom_js');
       ```
   
 *  Thread Starter [rosuna](https://wordpress.org/support/users/rosuna/)
 * (@rosuna)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/code-in-the-head-section/#post-4379850)
 * Thank you but I have added that code to the functions.php file in the child theme,
   I have deleted the cache, and it seems that ir is not working.
 * The line of code is not in the HEAD section when I look at the web source code.
 *  [tomaja](https://wordpress.org/support/users/tomaja/)
 * (@tomaja)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/code-in-the-head-section/#post-4379919)
 * Ok, it should work with wp_enqueue_script
 *     ```
       function custom_js() {
           wp_enqueue_script('myscript', 'http://ads.redcoruna.com/delivery/spcjs.php?id=50', false, '1.0' );
       }
       add_action ('wp_enqueue_scripts','custom_js');
       ```
   
 *  Thread Starter [rosuna](https://wordpress.org/support/users/rosuna/)
 * (@rosuna)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/code-in-the-head-section/#post-4379920)
 * It doesn´t work 🙁
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [12 years, 6 months ago](https://wordpress.org/support/topic/code-in-the-head-section/#post-4379921)
 * What do you mean by doesn’t work, is your JS file loaded in the page first?
 *  [tomaja](https://wordpress.org/support/users/tomaja/)
 * (@tomaja)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/code-in-the-head-section/#post-4379922)
 * I just checked it on my testing site and it works, it loads the script to the
   head
 *  Thread Starter [rosuna](https://wordpress.org/support/users/rosuna/)
 * (@rosuna)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/code-in-the-head-section/#post-4379923)
 * When I write this line in the class-header-header_main.php file (in the Customizr
   theme), it is shown when I look at the web source code using any browser.
 * `<script type='text/javascript' src='http://ads.redcoruna.com/delivery/spcjs.
   php?id=50'></script>`
 * But I prefer not to change the Customizr theme and if I modify the functions.
   php in the child theme as you suggest, I can´t see that line in the web source
   code.

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

The topic ‘Code in the HEAD section’ is closed to new replies.

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

## Tags

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

 * 7 replies
 * 3 participants
 * Last reply from: [rosuna](https://wordpress.org/support/users/rosuna/)
 * Last activity: [12 years, 6 months ago](https://wordpress.org/support/topic/code-in-the-head-section/#post-4379923)
 * Status: not resolved