Title: Loading javascript from child-theme, get_header() error?
Last modified: August 20, 2016

---

# Loading javascript from child-theme, get_header() error?

 *  Resolved [Gabriel](https://wordpress.org/support/users/gabriel78h/)
 * (@gabriel78h)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/loading-javascript-from-child-theme-get_header-error/)
 * Whenever I try to load my javascript file from my child-theme functions.php, 
   I get this odd error from the theme:
 *     ```
       <br />
       <b>Fatal error</b>:  Call to undefined function get_header() in <b>C:\xampp\htdocs\greekstone\wp-content\themes\the-bootstrap\index.php</b> on line <b>17</b><br />
       ```
   
 * My functions.php has:
 *     ```
       <?php
       add_action('wp_enqueue_scripts','my_gss_scripts');
       function my_gss_scripts() {
       	wp_register_script('flyingIMG', get_template_directory_uri('flyingIMG.js', __FILE__), array('jquery'), false, true);
       	wp_enqueue_script('flyingIMG');
       }
       ?>
       ```
   
 * Happens regardless of plugins loaded, and even if flyingIMG.js is a blank file.
   I’m working locally.

Viewing 1 replies (of 1 total)

 *  Thread Starter [Gabriel](https://wordpress.org/support/users/gabriel78h/)
 * (@gabriel78h)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/loading-javascript-from-child-theme-get_header-error/#post-3499456)
 * Nevermind, figured it out

Viewing 1 replies (of 1 total)

The topic ‘Loading javascript from child-theme, get_header() error?’ is closed to
new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/the-bootstrap/2.0.3/screenshot.
   png)
 * The Bootstrap
 * [Support Threads](https://wordpress.org/support/theme/the-bootstrap/)
 * [Active Topics](https://wordpress.org/support/theme/the-bootstrap/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/the-bootstrap/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/the-bootstrap/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [Gabriel](https://wordpress.org/support/users/gabriel78h/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/loading-javascript-from-child-theme-get_header-error/#post-3499456)
 * Status: resolved