We've got 524 people subscribed to ROCKFUSE,
who know that we don't dissapoint our readers!
Tips and Resources for Bloggers, Internet Marketers and Entrepreneurs

How to add AdSense Code to the middle of every Blog Post within 5 minutes, automatically!

inline_wraptop Today I’ll be posting a step by step guy on how to add Inline AdSense code to the middle of your blog posts. Not only AdSense, but you can use this for Yahoo! Publisher Network ads, Bidvertiser and etc. We’ll be going through all the details and utilizing a plugin, and a simple theme hack to complete the trick which will add AdSense block within all your blog posts, published already and to be be published.

But, first of all, why would you want to add inline AdSense Code? Because that improves your AdSense Ad block visibility. You blog post will wrap around the Inline AdSense slot, so that’ll make sure a good number of your visitors reading the post will ultimately see the Ad – instantly boosting your AdSense CTR…

Ready? Here we go… We will insert a blog of AdSense code to everyone of your posts, making the post wrap around the block, to the top left corner. (I’ll show you how to customize this later in the post)

The Method – Adding AdSense code

1. Copy your AdSense code and keep it in the clipboard.

2. Open your wordpress theme editor and open the Single Post Template (single.php) or whichever the template file for your Single Posts. (We’ll add AdSense only to the individual posts)

How to add Inline AdSense Code to every Blog Post

3. Then find the line of code which says:

<?php the_content(’Read the rest of this entry &raquo;’); ?>

4. Got it? Awesome! Now, right before this code, insert a new line and type out the following coding. Replace <your AdSense code here> with your AdSense code. (A screen shot is given below)

<div style=”float:left;”><your AdSense code here></div>

How to add Inline AdSense Code to every Blog Post

5. Update your theme changes! And you’re done with adding the AdSense code.

Now, you must be able to see an AdSense code being placed Inline with all your posts to the top left corner.

How to customize the position?

Simple. First, you must understand a few things.

One, the php code you hunted down: “<?php the_content(’Read the rest of this entry &raquo;’); ?>” – resembles the function which will call your blog posts’ text. Not the header, just the text and the body content i.e. Images and etc. So, if you insert the AdSense code after this line, unlike the previous example, you should see the AdSense block after each post.

Two, in the Div Container code: “<div style=”float:left;”><your AdSense code here></div>” – “float: left;” means that you’d align the AdSense block to the left of the post. To make it align to the opposite end, just replace it with “float: right;”.

So, there you go. I hope you’ll find this useful. If there’s anything you’d like to know or clarify, just shoot me a message.

 

20 Responses to “How to add AdSense Code to the middle of every Blog Post within 5 minutes, automatically!”

  1. 1stAngel says:

    It isnt working :( http://ourgym.co.uk I put it in exactly as you said but nothing shows, not even a gap :(

  2. Muneeb says:

    Wow !!! I never thought about this :)

    Thanks for sharing .. that will surely can increase potential of earnings via adsense ..

    Cheers

  3. Hmmm.. That is very unlikely. I’m sure this should work since I followed the exact same steps for one of my other blogs yesterday. Are you using any cache plugins on our gym?

  4. 1stAngel says:

    I don’t know if I am or not. I am going to test it again…. may even be the server cache

  5. 1stAngel says:

    No, tested and it definitely isnt showing :( I would love this but I think Im not having it LOL

  6. Hmm.. Can’t think of a logical reason as to why. If you can send me the edited single.php file I can take a look.

  7. Sandarenu says:

    I heard somewhere that Google only allow 3 AdSense blocks per page. Is that what causing you this problem?

  8. Yes, that’s true. AdSense only allows three blocks per page. But this was a simple misplacement in her file. And it works fine for her now.

  9. bonoriau says:

    Thanks for the very informative tips…I always wondering how the other blogger position the adsense in the middle of posting.

  10. Shireishou says:

    Ah.. .I wish I know this tutorial before getting depress managing my Single.php code.wahaha U did amazing jobs in writing tutorial.I already able to put the adsense code at my post. But since I use small view to post, I put it on top ^^

  11. Nihar says:

    I knew this tip from long time. was also using it when i was using blogger platform… But it is a very important thing to do if you want to get good CTR Rate.

  12. Sunil Pathak says:

    Hi Nadeesha
    thanx for the great tips i am not using any advertising service at the moment on my blog
    but i will surely use your trick when i use one :D

  13. Ivi says:

    What if I want to align it in the middle of the post. Not in the beginning, not end.

  14. Jayen says:

    Hey that’s great, but what about actually adding it to the middle of the post ;) EI Half way down the text of the post? I’d like to try adding an extra adsense bloc their :twisted:

    DO you have to create various loops or something?

    Thanks

    Jayen

  15. Hmm.. the easiest way to do that is to develop a plugin that insert adsense code automatically after a X number of words, breaking the paragraphs..

  16. Jayen says:

    I’ve been looking for a plugin for it but so far no luck :|

    Still for now i applied your method, i had to learn a little CSS to get it to wrap around the text thou, i ended up editing it like this:

    That works well :P Now to tidy it up and put it in my style sheet.

    Thanks for the post, i’ve sub to your feed :) i’d been meaning to figure out how to do this for a while.

    Jayen

  17. Cool, this is where I got my single.php edited, the place where I learned how! thanks a lot!

  18. Alfie says:

    I`m also looking to such kind of plugin that insert the adsense code after X numbers of text. But so far, no luck. Hope someone will spend time for this.

  19. Samrat Khan says:

    I cant find this coder [ ] anywhere.

    In my template has this coder []..

    What can i do?

  20. Gads Decoder says:

    Thanks very much, it’s realy work for blogspot. Thanks friend…

Leave a Reply

Powered by Wordpress | Designed by Elegant Themes