• Hi. I am currently adding code to run BuySellAds on my blog. I am a little tripped up by needing to add some code to my header.php file. The step one code needs to be installed just beneath the opening body tag of my website. I was told I could find this in the header.php file. So, I went to that file and didn’t see anything that said <body> and the closest thing I could find was this code.

    <body <?php body_class() ?>>
    <div id=”wrapper”>
    <header id=”header”>

    Where the heck do I put this code they’re talking about?

    I don’t know what the difference is and I don’t want to insert code anywhere that it doesn’t belong. If someone has any suggestions or has installed the BSA.com code to their header.php file I would be greatly appreciative of some advice! I just want to get this up and running and I’m not understanding the steps involved.

Viewing 5 replies - 1 through 5 (of 5 total)
  • What theme are you using? Where did you download it from?

    Thread Starter Bebe555

    (@bebe555)

    Pinboard theme from onedesigns

    In that case, do not edit the theme itself. First create a child theme for your changes and add a copy of header.php to your new child theme. In theory, your code can then be added just after <body <?php body_class() ?>> in the new header.php file.

    Thread Starter Bebe555

    (@bebe555)

    Thanks for the link on how to create a child theme! So, what you are saying is I create a child theme copy all the code from the header.php into this child theme I created and put the code they are instructing me to add right after the <body <?php body_class() ?>>

    Also, I need to add code to the zones I want to ad the ads to appear. This is step 2. So, if I am running the ads on my sidebar, do I take my sidebar.php, make a child theme as well of it, put the code in from my sidebar.php and then add the code they are telling me to add? Just want to make sure while I have your help.

    Basically it sounds like you’re saying that a child theme is created so that you don’t have to mess with the original theme in case of problems, right?

    I create a child theme copy all the code from the header.php into this child theme I created and put the code they are instructing me to add right after the <body <?php body_class() ?>>

    Bingo! 🙂

    If you don’t Do this, your changes will be over-written the next time you update the theme (and you will keep the theme updated, won’t you?). Child themes keep your customisations safe.

    Also, I need to add code to the zones I want to ad the ads to appear.

    Depending upon what you are adding, you may be able to get away with just using a Text widget as a holder for this in your sidebar.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Header.php Body tag’ is closed to new replies.