Insert google adsense code in wordpress blog?

Discussion in 'JavaScript' started by Cheapvpsoffers, Jan 17, 2011.

  1. #1
    Hello,

    I recently started wordpress blog and now all set to add google ads on my blog. Now, I am trying to add google codes in each post below title and above comment box. I did try to find out on google, all they say is to edit single.php which i edited but its pretty different in my case. So, I got confused. I am compltely noob of coding infact zero. I posted below my single.ph file. I would be grateful to someone who can guide me through.


    Thanks
     
    Cheapvpsoffers, Jan 17, 2011 IP
  2. s_ruben

    s_ruben Active Member

    Messages:
    735
    Likes Received:
    26
    Best Answers:
    1
    Trophy Points:
    78
    #2
    Try this method:

    
    <?php
    get_header();
    
    if (have_posts())
    {
    while (have_posts())
    {
    art_page_navi();
    ?>
    google ads here
    <?php
    art_post();
    ?>
    google ads here
    <?php
    comments_template();
    }
    art_page_navi();
    } else {
    art_not_found_msg();
    }
    
    get_footer(); 
    
    PHP:
     
    s_ruben, Jan 17, 2011 IP
  3. bhuthecoder

    bhuthecoder Member

    Messages:
    245
    Likes Received:
    11
    Best Answers:
    1
    Trophy Points:
    43
    #3
    r u using free wordpress blog or own server ?
    send me PM i will insert the ads code
     
    bhuthecoder, Jan 17, 2011 IP
  4. Cheapvpsoffers

    Cheapvpsoffers Member

    Messages:
    59
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #4
    Thanks.. but using this code ads are appearing above title where i want ads to be appeared below title i.e. in between title and post.. thanks so far....
     
    Cheapvpsoffers, Jan 19, 2011 IP
  5. s_ruben

    s_ruben Active Member

    Messages:
    735
    Likes Received:
    26
    Best Answers:
    1
    Trophy Points:
    78
    #5
    Can you find and write the function art_post() here? I think it is in the functions.php file of the theme directory.
     
    s_ruben, Jan 19, 2011 IP