Title: Javascript in header.php only called on root page?
Last modified: August 18, 2016

---

# Javascript in header.php only called on root page?

 *  [cordeliamars](https://wordpress.org/support/users/cordeliamars/)
 * (@cordeliamars)
 * [19 years, 2 months ago](https://wordpress.org/support/topic/javascript-in-headerphp-only-called-on-root-page/)
 * Hi!
    In the Head tag in Header.php, I put a javascript that makes all three columns
   in my theme equal height.
 * The script was recommended at Sitepoint and used to work fine.
 * Suddenly for no reason that I can spot, the javascript only gets executed when
   the root page is loaded. The root page is at [root page](http://www.vikingprincess.net)
 * However if I load any other page on the site, the javascript does not get called
   in header.php, and the column height is not adjusted. See [non root page](http://www.vikingprincess.net/29/site-design-feedback-needed)
 * This behaviour seems very strange. I think it may be WP related – something to
   do with the way in which WP loads the different pho files…
 * Please help if you can!
    C.

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

 *  Thread Starter [cordeliamars](https://wordpress.org/support/users/cordeliamars/)
 * (@cordeliamars)
 * [19 years, 2 months ago](https://wordpress.org/support/topic/javascript-in-headerphp-only-called-on-root-page/#post-531802)
 * I never rarely seem to get answers here anymore. Not sure why!
 * Anyway, the solution was to put
 *     ```
       <script src="/x.js" type="text/javascript"></script>
   
                instead of 
   
       <script src="x.js" type="text/javascript"></script>
       ```
   
 * Still no idea why the absolute path didn’t work..
 *  [Chris_K](https://wordpress.org/support/users/handysolo/)
 * (@handysolo)
 * [19 years, 2 months ago](https://wordpress.org/support/topic/javascript-in-headerphp-only-called-on-root-page/#post-531803)
 * Not to be snarky, but sometimes it may take an (unpaid) volunteer more than 1
   hour to help.
 *  Thread Starter [cordeliamars](https://wordpress.org/support/users/cordeliamars/)
 * (@cordeliamars)
 * [19 years, 2 months ago](https://wordpress.org/support/topic/javascript-in-headerphp-only-called-on-root-page/#post-531804)
 * Ok, that’s a good point. I didn’t think of it that way.
    **I’ll have a look around
   for any newbies that I can help!** (If you are a non-moderator reading this, 
   why don’t you do the same? )
 * I recognise your name and I know that you and VKaryl are doing a super job. Sorry,
   didn’t mean to come out that way at all!
 * Also, sometimes it can be very difficult to understand what people are on about–
   they may not express their problem very clearly!
 *  [Chris_K](https://wordpress.org/support/users/handysolo/)
 * (@handysolo)
 * [19 years, 2 months ago](https://wordpress.org/support/topic/javascript-in-headerphp-only-called-on-root-page/#post-531812)
 * > I’ll have a look around for any newbies that I can help!
   >  (If you are a non-
   > moderator reading this, why don’t you do the same? )
 * By all means, wade in! Not everybody can answer every question, but if you look
   at a few I bet you’ll find some that you can take on.
 * Side note: Akismet keeps trapping your posts. Bear with us as I continue to “
   train” it. So, if your posts don’t show up immediately, they will eventually.
   Apologies for that.

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

The topic ‘Javascript in header.php only called on root page?’ is closed to new 
replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [Chris_K](https://wordpress.org/support/users/handysolo/)
 * Last activity: [19 years, 2 months ago](https://wordpress.org/support/topic/javascript-in-headerphp-only-called-on-root-page/#post-531812)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
