1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to Add Adsense ads inside wordpress Blog without Using Plugin

Discussion in 'Blogging' started by T2tkid, Aug 2, 2011.

  1. T2tkid

    T2tkid Jr. VIP Jr. VIP Premium Member

    Joined:
    Oct 13, 2010
    Messages:
    3,638
    Likes Received:
    1,673
  2. CyberSEO

    CyberSEO Senior Member

    Joined:
    Jul 14, 2011
    Messages:
    959
    Likes Received:
    262
    Occupation:
    programmer
    Home Page:
    Simple hardcode it into the theme.
     
  3. uncguy4321

    uncguy4321 Regular Member

    Joined:
    Jul 10, 2011
    Messages:
    340
    Likes Received:
    120
    Occupation:
    Part time contractor and consultant...but full tim
    Location:
    Parts unknown (eastern US)
    Depending on where you want it...I use a div tag. For instance, say you use the 250 x 250 block. Without the brackets, just in case this forum blocks html: div style="width:250px; height:250px; margin:8px; float:left;"> YOUR ADSENSE CODE HERE /div>

    Something like that should do the trick for you.
     
    • Thanks Thanks x 2
  4. T2tkid

    T2tkid Jr. VIP Jr. VIP Premium Member

    Joined:
    Oct 13, 2010
    Messages:
    3,638
    Likes Received:
    1,673
  5. KamBhai

    KamBhai Power Member

    Joined:
    Aug 13, 2010
    Messages:
    708
    Likes Received:
    606
    Gender:
    Male
    Occupation:
    IM
    Location:
    Sweet Home
    Hey very easy buddy,
    Go to widgets then add "TEXT" to your sidebar and put your adsense code there, it will work only for sidebars.
    For header and footer, go to your theme folder then find header.php and footer.php and insert your codes there.
    that's it :)
     
  6. samlim

    samlim Junior Member

    Joined:
    Jun 7, 2011
    Messages:
    158
    Likes Received:
    16
    let say i want to include it in every post i make automatically ??

    how should i go about doing it?
     
  7. T2tkid

    T2tkid Jr. VIP Jr. VIP Premium Member

    Joined:
    Oct 13, 2010
    Messages:
    3,638
    Likes Received:
    1,673
    Here that is what i want to know, how do i add adsense ads INSIDE POSTS?
    I have it in my sidebar.
     
  8. CyberSEO

    CyberSEO Senior Member

    Joined:
    Jul 14, 2011
    Messages:
    959
    Likes Received:
    262
    Occupation:
    programmer
    Home Page:
    1) Open your index.php in notepad.
    2) Find something like this:
    Code:
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    3) Put your adsense code right below.
    4) Do the same with single.php and archives.php if you have them.
    5) Upload the modified theme to your /wp-content/themes/
    6) Enjoy!
     
    • Thanks Thanks x 1
  9. kido84

    kido84 Newbie

    Joined:
    Jan 27, 2011
    Messages:
    6
    Likes Received:
    0
    i cant see the ads from opera mobile..anyone know this?
     
  10. T2tkid

    T2tkid Jr. VIP Jr. VIP Premium Member

    Joined:
    Oct 13, 2010
    Messages:
    3,638
    Likes Received:
    1,673
    Cyberseo
    should i copy and post the adsense codes inside the index.php?
    Or use something like this:
    div style="width:250px; height:250px;margin:8px; float:left;"> YOUR ADSENSE CODE HERE /div>

    thanks.
     
  11. CyberSEO

    CyberSEO Senior Member

    Joined:
    Jul 14, 2011
    Messages:
    959
    Likes Received:
    262
    Occupation:
    programmer
    Home Page:
    If you want to put it right below the post, you don't need any div's there.
     
  12. _Chip_

    _Chip_ Senior Member

    Joined:
    Jun 28, 2009
    Messages:
    847
    Likes Received:
    256
    Occupation:
    Student
    Location:
    Depends on my vpn
    @op

    goto the theme files(not root index.php), goto wp-content/themes/yourtheme ...

    there you will see the files ... index.php, header.php, footer.php, page.php, single.php ...
    header is the same for the whole site, so if you want a sitewide google ad somewhere in the header area, you have to edit the header.php and code the ad code, and position it using div tabs, margins etc ..

    Same with the footer, footer.php is same for the whole site....

    single.php is the template for POST, if you want an ad to show up in all the posts, edit this file, and drop the code accordingly.

    page.php is the template for a PAGE, the ad will show in all the pages ...

    If you want to put an ad in the sidebar, you can use the text widget in the widget section...
     
    • Thanks Thanks x 1
  13. T2tkid

    T2tkid Jr. VIP Jr. VIP Premium Member

    Joined:
    Oct 13, 2010
    Messages:
    3,638
    Likes Received:
    1,673
    @CyberSeo
    I want to add the ads inside the post. Not below the post.
    Thanks.
    @_chip_
    thanks for your tutorial, but my theme don't have single.php, any other idea where to place the code?
     
  14. CyberSEO

    CyberSEO Senior Member

    Joined:
    Jul 14, 2011
    Messages:
    959
    Likes Received:
    262
    Occupation:
    programmer
    Home Page:
    What do you mean on "inside"? Any example?
     
  15. T2tkid

    T2tkid Jr. VIP Jr. VIP Premium Member

    Joined:
    Oct 13, 2010
    Messages:
    3,638
    Likes Received:
    1,673
    The google adsense ads will be inside the post, either by the right or left.
    Or below the title of the post.
     
  16. _Chip_

    _Chip_ Senior Member

    Joined:
    Jun 28, 2009
    Messages:
    847
    Likes Received:
    256
    Occupation:
    Student
    Location:
    Depends on my vpn
    enlist what all files you have?
     
  17. black.hat1

    black.hat1 Registered Member

    Joined:
    Jul 16, 2011
    Messages:
    63
    Likes Received:
    18
    Step 1: Login to your blog as administrator
    Step 2: Click on Appearance
    Step 3: Select Widgets
    Step 4: Select the sidebar you want (Default Sidebar 1)
    Step 5: Add Text widget
    Step 6: Click on Edit widget
    Step 7: Enter Caption. I have used ?Useful Links?
    Step 8: Paste your Google Adsense code in the text area. See example code
     
  18. uncguy4321

    uncguy4321 Regular Member

    Joined:
    Jul 10, 2011
    Messages:
    340
    Likes Received:
    120
    Occupation:
    Part time contractor and consultant...but full tim
    Location:
    Parts unknown (eastern US)
    I shouldve clarified my code above...my code was to put the code IN the post, and if you put my code in your post first, then write your content (remmeber to put my code in the HTMl section), then your adsense will be top-left and your content will wrap around it. Also keep in mind I didnt post some of the brackets such as < >
     
    • Thanks Thanks x 1
  19. SyZygy

    SyZygy Senior Member

    Joined:
    Dec 29, 2009
    Messages:
    864
    Likes Received:
    1,081
    Location:
    Europe
    Home Page:
    Did not worked for me, just pasted the code but it does not show up :/
     
  20. Tetragen

    Tetragen Newbie

    Joined:
    Aug 2, 2011
    Messages:
    1
    Likes Received:
    0
    It saves as a blank text widget.