Dec 17 2007

How to wrap text around an adsense block in a Wordpress post

If you're new here, you may want to start with my most popular posts. Then, subscribe to my RSS feed to stay updated. Thanks for visiting!

Google Query: how to wrap text around adsense block

Some of the readers of this blog have been asking me how I wrap the text around the adsense block in the beginning of the posts. After some Googling, I found an article to get me started over at The summary is listed below.

With my particular theme, all I did was put the adsense code between two divs. The <div> element turns the text in between the <div> and </div> tags into an object that can be manipulated by styles. The easiest way to explain it would be to show the code.
<div style="float: left;">300x250 Adsense Code Here</div>
That is using the raw adsense code. If you are using Phil Hord’s Adsense Inline Plugin, the code would look similar to the line below:
<div style="float: left;"><!--adsense--></div>

That’s it! I basically told the 300×250 adsense block to float on the left of the post (allowing the post text to wrap around the right side of the block). Happy Blogging!

Technorati Tags: , ,

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.


9 Comments on this post


  1. james said:

    And the code is supposed to be placed where in the file? I need more detail than that?

    January 2nd, 2010 at 12:47 am
  2. hstagner said:


    Are you asking if you need more detail? If so, then only you can answer that.

    Anyway, you put the code in your blog post where you want the adsense block to appear.

    January 2nd, 2010 at 9:06 am
  3. bobin said:

    thanks, was searching for this

    May 21st, 2010 at 12:00 pm
  4. Jenn said:

    Wauuuvvv.. Thanks.

    June 17th, 2010 at 12:08 pm
  5. charles said:

    Do I need to manually post this adsense code in each and every blog post?Or do I just have to put this in some of the .php file in the wordpress menu?
    Also is there any way that I can have the adsense ads appear at the start and end of each article where the ads appearing at first should be having the blog posts wrapped around and the ads appearing last just to be left over intact untouched.Thanks

    July 7th, 2010 at 5:22 am
  6. Sam said:

    Thanks for the code, I’ve tested it and worked like a charm.
    To put on wordpress, just open your singlepost template and put this code before the code, so it will be like this.

    300×250 Adsense Code Here

    July 20th, 2010 at 8:26 pm
  7. Nadia said:

    Thanks! I’ve been struggling for an hour trying to wrap the text around my ad blocks. Your little piece of code fixed my problem within seconds :-)

    November 20th, 2010 at 6:02 am
  8. Mo said:

    I have recently got a website that shows Google ads in the posts. my question is where can i find this code if i wanted to get rid of it and how ??? i thought by disabling the ads in the ads manager would take care of it but it looks as if the code is embedded in the site. any help would be appreciated. thanks.

    P.S. the site in question is

    www. exerciseanddietplans .com

    you will notice that in every post there is a Google ad right before the comments. the 468×60 text and banner ad. please help me figure out, how i can get rid of it.

    March 6th, 2011 at 9:48 pm
  9. sam said:

    TX, this was a really painless process!!
    And it looks much better now, doen’t it?

    May 9th, 2011 at 9:46 am


Subscribe Form

Subscribe to Blog


Recent Readers

                  Computers Blogs - Blog Top Sites