• I have a small problem I need help with. I’m placing my Adsense code in my header, which naturally loads the Adsense banners in the headers of all of my pages. But what I want to do is make it where the Adsense banners load on all the pages EXCEPT my home page. I want to have my own custom banners load on the home page instead.

    Can someone help me with how I would code my header.php to accomplish this? I tried using the following code, but couldn’t get it to work for me.

    if(is_page('Home')){
    echo '<img src="the-path-to-your-image/about.jpg" />';
    }
    <?php else : ?><Adsense script>

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,

    I just tested this code on my homepage header with WordPress 3.2.1

    <?php
    if(is_home()) {
    echo "<br>yes it is the home page<br>";
    } else {
    echo "<br>not the home page<br>";
    }
    ?>

    I hope this helps.

    Bob Cristello
    http://tweetclean.com

    Thread Starter xxatti

    (@xxatti)

    Thanks, that worked. But I had to change the double parenthesis in the echo to single parenthesis.

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

The topic ‘Custom page headers with Adsense’ is closed to new replies.