1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Where to place my adsense code?

Discussion in 'WordPress' started by rookiethomas, Apr 15, 2009.

  1. #1
    I have an adsense banner that I want to go directly under the title of each new blog post. Where do I paste that code in on the Editor Side? Somewhere in the header.php file? Or the main index.php file?
    SEMrush
     
    rookiethomas, Apr 15, 2009 IP
    SEMrush
  2. deluxdon

    deluxdon Catch Me If You Can...!!!™ Staff

    Messages:
    25,468
    Likes Received:
    1,941
    Best Answers:
    32
    Trophy Points:
    480
    #2
    If you want to add it at homepage then main index.php (but only first 3 posts display that ad under title as per adsense rule) and if you want it in all seperate post then put it under single.php

    DON.
     
    deluxdon, Apr 15, 2009 IP
    suman817 likes this.
  3. Random Guy

    Random Guy Peon

    Messages:
    670
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Do you also want to get banned from adsense?
     
    Random Guy, Apr 15, 2009 IP
  4. rookiethomas

    rookiethomas Peon

    Messages:
    48
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    No of course I do not want to get banned. DUH!!! Obviously I don't know this is why I'm asking. Will the ads only show a max of 3 times. Or will it show under every post?
     
    rookiethomas, Apr 18, 2009 IP
  5. hmansfield

    hmansfield Guest

    Messages:
    7,904
    Likes Received:
    298
    Best Answers:
    0
    Trophy Points:
    280
    #5
    I think what he is saying.....if I remember correctly (I don't use adsense anymore) is that you can only display 3 adsense blocks per page, so if you are displaying it under every title, and you have more than 3 posts on the first page, you will run into trouble (not to mention turning off readers).

    If you put it in single.php, it will display when the entire post is displayed, only.
     
    hmansfield, Apr 18, 2009 IP
  6. Random Guy

    Random Guy Peon

    Messages:
    670
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Then don't put ads under the post title :)
     
    Random Guy, Apr 18, 2009 IP
  7. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Adding it to header.php will not put ads under the posts, it has to go in index.php. The code also needs to count how many loops its done to limit the ads. But later on you might put ads in the header, footer or sidebar and then you have to change the code again.

    You can avoid all that trouble by using Adsense Manager
     
    Cash Nebula, Apr 18, 2009 IP
  8. RifqiAF

    RifqiAF Active Member

    Messages:
    218
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    58
    #8
    try using wordpress plugin called "all in one adsense and ypn", you can setup adsense code easily under the title or even randomly inside the post....
     
    RifqiAF, Apr 19, 2009 IP
  9. godokuwn

    godokuwn Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    if you use wp, you can use adsense manager plugin.
     
    godokuwn, Apr 19, 2009 IP
  10. Houdy

    Houdy Peon

    Messages:
    267
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #10
    I have a WP blog setup to show an AdSense ad block under each post (actually excerpt but that doesn't matter) on the main page. The code was added directly to the themes index.php file with no plugin and it automatically only shows three ad blocks although there are 10 post excerpts showing on the page. It has been this way for years with no problems or being banned.
     
    Houdy, Apr 19, 2009 IP
  11. Woody10

    Woody10 Well-Known Member

    Messages:
    170
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    115
    #11
    search google for a plugin called whydowork adsense. it will solve all your problems
     
    Woody10, Apr 19, 2009 IP
  12. UIS4821

    UIS4821 Peon

    Messages:
    354
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Your best bet is a plugin.

    Also, I think you can have 4 adsense blocks now. Don't quote me on that however.
     
    UIS4821, Apr 19, 2009 IP