WordPress.org

Ready to get started?Download WordPress

Forums

Rollover code help needed (2 posts)

  1. rocipo
    Member
    Posted 12 months ago #

    Hi all-

    I'm using an HTML editor to create some rollover buttons for my site and I need some help and/or clarification. My editor says that I need to paste some code (javascript) into the <HEAD> section of an HTML page. Is that the same as pasting into the header.php file? Actually, it says I need to paste some code into the <HEAD> section and the actual link reference into the <BODY> section. I think that I can figure most of this out with the exception of the above question. I'm using a child theme so I'll also assume that I need to copy my header.php page into my child theme first IF my assumption is correct.
    Does anyone have any experience with this? I'd love to be able to finally start to add some of my own code into WordPress, but I just need some basic knowledge first.
    Thanks all for any insight.

  2. catacaustic
    Member
    Posted 12 months ago #

    In the header.php file you'll see a lot of HTML tags. The main one that you want to look for is:

    <head> ... </head>

    That's what it means when it talks about the HEAD area. As you're adding some JavaScript I'd probably recommend that you paste in in just above the closing </head> tag.

    You can paste the link anywhere after the <body> tag, but where you poaste in it is going to affect where it's displayed. That may take a bit of trial-and-error on your part to get it right, but remember that there's a lot more template files that make up a standard page so you might need to check a few of them in order to get the positioning right.

    And yes, you should copy the header.php file into yoru child theme. I'm glad to see that someone's actually thinking of that before we tell them!

Reply

You must log in to post.

About this Topic