WordPress.org

Ready to get started?Download WordPress

Forums

adsense meshing in with single post (5 posts)

  1. remdog
    Member
    Posted 7 years ago #

    Howdy :)

    I have a quick question about placing adsense within my blog posts. I have put them in the loop to show between the article and the comments section. But I have seen adsense squares embedded in the actual single article like top right or top left. Can anybody point me in the right direction?

    You can see my current blog I am working on here:
    http://www.maineoutdoorstoday.com/blog/

  2. remdog
    Member
    Posted 7 years ago #

    ok I will do another google search and hopefully find it this time...

  3. Yngwin
    Member
    Posted 7 years ago #

    Wrap the adsense code in a div, place it before the post content, then float that div either left or right.

  4. remdog
    Member
    Posted 7 years ago #

    so just something like this

    <div align="right"><script=adsense code blah blah></script></div>

    begin post content here

  5. ptvguy
    Member
    Posted 7 years ago #

    I use basic DIV tags wrapped around my adSense code as you wrote above, but I added some formatting to the CSS file for my theme so that I could have more control over how each ad displays:

    /* ---------------------------------
    - GOOGLE ADVERTISING CSS -
    --------------------------------- */

    .adleft {
    display: block;
    float: left;
    padding: 0 2px 2px 0;
    }

    .adright {
    display: block;
    float: right;
    padding: 0 0 2px 2px;
    }

    .adtop {
    display: block;
    float: left;
    padding: 3px 0 0 0;
    }

    .adfirefox {
    display: block;
    text-align: center;
    padding: 2px 0 0 0;
    }

    .adside {
    display: block;
    text-align: center;
    padding: 10px 0 0 0;
    }

    .adbottom {
    display: block;
    float: left;
    padding: 3px 0 3px 10px;
    }

    Therefore, to use your example above, I would write it into my post as follows:

    <div class="adright"><script=adsense code blah blah></script></div>

    This allows my post text to wrap around my advertising (which I've set up to match my site theme as closely as possible.) If you're wondering about the rest of those classes defined in there, adtop and adbottom apply to the big "Get Firefox" button/banner at the top and bottom of by pages, the adside controls most of the sidebar advertising, and the adfirefox controls the big "Get Firefox" button on the sidebar. You ought to be able to adapt or delete these to work on your site.

    Also, if you haven't already gotten it, I highly recommend the Adsense-Deluxe plugin from Acme Technologies.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags