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.

Wordpress Tips : Place Adsene between on post 1 with post 2

Discussion in 'Placement / Reviews / Examples' started by Farina, Apr 15, 2007.

  1. #1
    To answer some question raise by member, this what i did in my blog :

    1. Open Index.php or home.php and find the following



    above that code add this

    <?php
    $postnum = 1;
    $showadsense1 = 1;
    $showadsense2 = 2;
    ?>


    2. scroll down until you see the following code

    above it add the following code


    <?php if ($postnum == $showadsense1) {
    echo '
    <script type="text/javascript"><!--
    google_ad_client = "pub-yourcode";
    google_ad_width = 300;
    google_ad_height = 250;
    google_ad_format = "300x250_as";
    google_ad_type = "text_image";
    //2007-03-11: raja_234
    google_ad_channel = "9384557134";
    google_color_border = "FFFFFF";
    google_color_bg = "FFFFFF";
    google_color_link = "A80f00";
    google_color_text = "7F7F7F";
    google_color_url = "666666";
    //--></script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
    ';
    } ?>

    <?php if ($postnum == $showadsense2) {
    echo '
    <script type="text/javascript"><!--
    google_ad_client = "pub-yourcode";
    google_ad_width = 336;
    google_ad_height = 280;
    google_ad_format = "336x280_as";
    google_ad_type = "image";
    //2007-03-11: raja_336
    google_ad_channel = "3113998377";
    google_color_border = "FFFFFF";
    google_color_bg = "FFFFFF";
    google_color_link = "A80f00";
    google_color_text = "7F7F7F";
    google_color_url = "666666";
    //--></script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
    ';
    } ?>
    <?php $postnum++; ?>
     
    Farina, Apr 15, 2007 IP
    rcj662 and guerilla like this.
  2. Farina

    Farina Peon

    Messages:
    250
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    This is the code if you wanna it appear after first post only.

    1. Open index.php and find the following

    above that code add this

    <?php
    $postnum = 1;
    $showadsense1 = 1;
    ?>


    2. scroll down until you see the following code


    above it add the following code


    <?php if ($postnum == $showadsense1) {
    echo '
    script type="text/javascript"><!--
    google_ad_client = "pub-yourcode";
    google_ad_width = 300;
    google_ad_height = 250;
    google_ad_format = "300x250_as";
    google_ad_type = "text_image";
    //2007-03-11: raja_234
    google_ad_channel = "9384557134";
    google_color_border = "FFFFFF";
    google_color_bg = "FFFFFF";
    google_color_link = "A80f00";
    google_color_text = "7F7F7F";
    google_color_url = "666666";
    //--></script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
    ';
    } ?>

    <?php $postnum++; ?>
     
    Farina, Apr 15, 2007 IP
  3. Farina

    Farina Peon

    Messages:
    250
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #3
    If want to appear in single page, use this

    1. Open single.php search the following code


    add your adsense code below above code.
     
    Farina, Apr 15, 2007 IP
  4. dsendecki

    dsendecki Peon

    Messages:
    212
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks for these tips — going to add these to my blog as soon as I get the opportunity!
     
    dsendecki, Apr 15, 2007 IP
  5. rcj662

    rcj662 Guest

    Messages:
    4,403
    Likes Received:
    97
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Nice tips. I am sure alot of people will like this tip.
     
    rcj662, Apr 15, 2007 IP
  6. webs

    webs Guest

    Messages:
    201
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I tried your tip and it didn't seem to work for me. I tried JUST AFTER THE FIRST POST. HELP!
     
    webs, Apr 16, 2007 IP
  7. Farina

    Farina Peon

    Messages:
    250
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #7
    webs ... email me your file .. i will do it 4 u
     
    Farina, Apr 16, 2007 IP
  8. hellopc

    hellopc Peon

    Messages:
    168
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Thank!!! very useful! :D
     
    hellopc, Apr 16, 2007 IP
  9. butterfingers

    butterfingers Well-Known Member

    Messages:
    1,142
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    128
    #9
    Any screenshot?
    Anyway, thanks for the tips.
     
    butterfingers, Apr 16, 2007 IP
  10. Farina

    Farina Peon

    Messages:
    250
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #10
    hi u can see at my 4000 FREE KEYWORDS blog (see signature)
     
    Farina, Apr 16, 2007 IP
  11. my_bk2000

    my_bk2000 Peon

    Messages:
    56
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Hi Farina , Thank for your Tip,

    There is a adsense plug-in for WordPress with which you can do same thing without modify the codes. The plug-in name is “Adsense Injection”, you can find this plug-in in Wordpress.

    The good thing is that with this plug-in do not need to modify the codes, and very flexible. You can choose the size of ads, modify color of ads, and how many ads to display, the position of ads, and control where start display the ads between post etc, and very easy to use. ( for some people it may not easy to modify the codes and not that flexible).

    You can see this plug working on this site : Best Video Clips

    My_bk
     
    my_bk2000, Apr 16, 2007 IP
  12. butterfingers

    butterfingers Well-Known Member

    Messages:
    1,142
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    128
    #12
    Never heard about Adsense injection.
    Thanks for the heads up.
     
    butterfingers, Apr 16, 2007 IP
  13. my_bk2000

    my_bk2000 Peon

    Messages:
    56
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #13
    my_bk2000, Apr 17, 2007 IP
  14. Bombaywala

    Bombaywala Peon

    Messages:
    1,249
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #14
    Bombaywala, Apr 17, 2007 IP
  15. Farina

    Farina Peon

    Messages:
    250
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #15
    TQ for the info.. the last plugin I used is adsense beautifier and adsense deluxe. This Ansense injection is new to me, anyway tq for that. :)
     
    Farina, Apr 17, 2007 IP
  16. webs

    webs Guest

    Messages:
    201
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #16
    Thanks for you help Farina, I did manage to get it work. Your advice has been most helpful. How is the Adsense Injection program going?
     
    webs, May 1, 2007 IP
  17. Bombaywala

    Bombaywala Peon

    Messages:
    1,249
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #17
    Adsense injection is good program for a site that is loaded with text. But after a while I got tired because the ads would show up randomly anywhere on the page and it got a bit annoying.
     
    Bombaywala, May 2, 2007 IP
  18. sussane

    sussane Active Member

    Messages:
    611
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    58
    #18
    thanks for this nice code....
     
    sussane, May 2, 2007 IP
  19. Farina

    Farina Peon

    Messages:
    250
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #19
    i just posted in my blog free adsense mint ebook you should download it free...
     
    Farina, May 4, 2007 IP
    Bombaywala likes this.
  20. webs

    webs Guest

    Messages:
    201
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #20
    Yeh that would be annoying - you really need to have that control over where you put your ads or else its pretty much pointless having them at all.

    Thanks mate, very interesting blog you've got there. Good luck with it.
     
    webs, May 7, 2007 IP