How to add html body attribute to Wordpress Theme files?

Discussion in 'WordPress' started by Meph, Mar 14, 2010.

  1. #1
    Hey guys,

    I need your help please. I am trying to add a javascript code into wordpress and the last bit I need to get it working is to add onunload="loadpopup()" as a body attribute in wordpress theme files.

    <body onunload="loadpopup()">

    I have tried to find the body tag in the index.php of the theme file as well as the index.php on the wordpress file but I can't seem to find this <body> tag all. Please tell me where I can add this body attribute for wordpress themes thank you!

    In case your wondering why the above, I am trying to add a javascript popup box whenever someone leaves the site by doing the following here:
    http://wsabstract.com/script/cut65.shtml

    Thats the last step I need to get this working.

    Meph
     
    Meph, Mar 14, 2010 IP
  2. lelkoun

    lelkoun Active Member

    Messages:
    288
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    60
    #2
    Just open the file called "header.php" and there is the <body> tag. :)
     
    lelkoun, Mar 14, 2010 IP
  3. Meph

    Meph Peon

    Messages:
    384
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Ooh thanks! That worked!
     
    Meph, Mar 14, 2010 IP
  4. DawnBaby

    DawnBaby Peon

    Messages:
    105
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    thx been looking for how to do this
     
    DawnBaby, Mar 14, 2010 IP
  5. talktome

    talktome Peon

    Messages:
    92
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Personally I would not use this as it is not good for user experience...
     
    talktome, Mar 17, 2010 IP