• cordeliamars

    (@cordeliamars)


    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

    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

    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

    (@cordeliamars)

    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

    (@handysolo)

    Not to be snarky, but sometimes it may take an (unpaid) volunteer more than 1 hour to help.

    Thread Starter cordeliamars

    (@cordeliamars)

    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

    (@handysolo)

    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.