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.

Adsense in wordpress posts [Help]

Discussion in 'WordPress' started by ironmaiden, Dec 27, 2008.

  1. #1
    Hello everyone i have a quick question can anyone show me how to insert adsense code in the top left/right corner of posts without the use of any plugin.
    Where exactly i have to insert the code an in which file if the template.
    One more thing I show full posts in my home page and is there any way not to show ads of the post in the home page, i just want to show them in the post only so that adsense TOS stays good.

    Here is the example what i want:

    [​IMG]
     
    ironmaiden, Dec 27, 2008 IP
  2. deluxdon

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

    Messages:
    25,480
    Likes Received:
    1,943
    Best Answers:
    32
    Trophy Points:
    480
    #2
    Regarding your 1st question. You need to add below given code where you want that image in your post.

    <div style="float:left; padding:0 10px 10px 0;"><img src="http://www.yourdomain.com/images/yourimage.jpg" alt="" width="200" height="150" /></div>
    Code (markup):
    Regarding your 2nd question. You need t add below given code in your index.php (template main index file) just below <div class="entry">.

    				<?php if($postcount<4)  
    					{ 
    						include (TEMPLATEPATH . "/adsense300x250.php");
    					}
    				?>
    Code (markup):
    and add one file adsense300x250.php with below given code

    <div style="float:right;width:300px;height:250px;margin:10px;">
    Your Google Adsense Code
    </div>
    Code (markup):
    DON.
     
    deluxdon, Dec 27, 2008 IP
    sainshea and MunnaMobile like this.
  3. ironmaiden

    ironmaiden Peon

    Messages:
    205
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thank you. I want to show adsense in place of that image can you please tell how to do so. I'll not add the image so please kindly tell where to insert the adsense code.
     
    ironmaiden, Dec 27, 2008 IP
  4. latoya

    latoya Active Member

    Messages:
    749
    Likes Received:
    73
    Best Answers:
    0
    Trophy Points:
    70
    #4
    When you set up your Adsense unit, choose "Image Ads Only" on the "Choose Ad Type" screen.
     
    latoya, Dec 27, 2008 IP
    MunnaMobile and sainshea like this.
  5. sainshea

    sainshea Peon

    Messages:
    1,329
    Likes Received:
    106
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks DON, it really was helpful and solved my problem too..
     
    sainshea, Dec 28, 2008 IP
    deluxdon likes this.
  6. deluxdon

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

    Messages:
    25,480
    Likes Received:
    1,943
    Best Answers:
    32
    Trophy Points:
    480
    #6
    Already answered your 2nd question too which is related to your querry. Using that you can add adsense to that place (image place).

    DON.
     
    deluxdon, Dec 28, 2008 IP
  7. silent_thunder

    silent_thunder Well-Known Member

    Messages:
    1,111
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    130
    #7
    Use a plugin its much easier
     
    silent_thunder, Dec 28, 2008 IP
  8. uca

    uca Well-Known Member

    Messages:
    2,242
    Likes Received:
    69
    Best Answers:
    0
    Trophy Points:
    155
    #8
    What plugin would do exactly that?
     
    uca, Dec 28, 2008 IP
  9. cathfan

    cathfan Peon

    Messages:
    52
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    I think a plugin called AdsenseDeluxe may solve your problem.
     
    cathfan, Dec 29, 2008 IP