WordPress.org

Ready to get started?Download WordPress

Forums

Put AdSense next to the post instead of top of post (9 posts)

  1. brandon88
    Member
    Posted 9 years ago #

    I know there's a plug-in for Adsense - however, i think it was written for Wp 1.2 and also it only puts the adsense in the banner format on top of the most recent post

    Is it possible to put the adsense next to the post itself, for example side by side with the most recent post, (NOT the sidebar!) perhaps in a vertical manner, and the text of the post adjusting to fit the Google ad...(try to visualize)

    pls help - it'll be great if there's a plugin for this

    thanks

  2. brandon88
    Member
    Posted 9 years ago #

    Some help here plse??

  3. Mark (podz)
    Support Maven
    Posted 9 years ago #

    Where is your WP site ?
    What have you tried ?

  4. halmowlez
    Member
    Posted 9 years ago #

    I use the Adsense plugin from Phil Hord that provides a quicktag to place the ad block inside a post, inside a CSS styled <div> to make the text wrap around the ad block.

    You need to be careful about how this is used to prevent multiple ad blocks showing in archives etc (refer to the Google TOS) - I only show one post at a time so have avoided the issue.

    Hope this works for you.

  5. aijohn
    Member
    Posted 9 years ago #

    I installed the adsense plugin and works great but I haven't figured out how to wrap text around the smaller Google blocks. Would be very apprciative f some very specific insructions on how to do this.

    Thanks

  6. davidchait
    Member
    Posted 9 years ago #

    I should have a plugin eventually that'll do most of this for you... for the moment:

    <div class="adsense">{{some adsense stuff}}</div>

    - change class="adsense" to "adsense-wide" or "adsense-tall" or whatever, to REALLY specify what the size/orientation is. That'll allow you to use different sized ads and CSS them differently.

    - in CSS, you then do something like:

    .adsense {
    float:right;
    padding: 10px;
    padding-right: 0;
    }

    - You can have up to three adsense blocks per page. After the third, they 'self-destruct' and don't show anything. But better to code it to know how many blocks you have and not try to show it again. ;)

    That what you're looking for? This is basically how I do my floating amazon product blocks in posts with CG-Amazon+CG-Inline. (Check any product news posting on my site as it's a good 'example' page. ;) ).

    -d

  7. ptvguy
    Member
    Posted 8 years ago #

    I use the AdSenseDeluxe plugin which allowed me to customize various ad sizes. I can pick from these various sizes at the time I create a post, use the one that best fits the size of that post, and drop it right in where I want it. Also, I wrap all my ads in DIVs to position them based on CSS classes I added into the theme CSS. It all looks fine and validates perfectly to XHTML 1.0 strict.

    BTW, I place AdSense in every single post even though I display five posts per page. I let Google sort out which are the first three and drop the rest. It doesn't hurt anything to have more than three; it just ignores the rest. This way I have an ad display even if someone views a single specific post or category.

  8. WildBil2Me
    Member
    Posted 8 years ago #

    brandon,

    In single.php or page.php you're best bet is to use the method suggested by davidchait. Take the adsense code and place it in a div, you can then float that div appropriately before the wordpress "the_content" tag. This will place the ad right next to the beginning of the post. (Depending on your writing style it'll sit next to the first paragraph or so of your post. Just remember that you'll encounter problems if you try adding an image or other block items at the start of anything new.)

    On index.php you need to add an additional step. Because the AdSense TOS restricts you from placing more than three blocks of code on any page you'll need to add some PHP to prevent the code from repeating more than you'd like.

    I've written a small post on "offsetting" posts which you can look at for some ideas.

    While ptvguy is correct, multiple occurences of the code won't display anything, it does appear to be a breach of the AdSense Program Policies and should be avoided.

  9. ptvguy
    Member
    Posted 7 years ago #

    While ptvguy is correct, multiple occurences of the code won't display anything, it does appear to be a breach of the AdSense Program Policies and should be avoided.

    Sorry, I hadn't looked back at this page in a while. I was incorrect in stating that Google was responsible for stopping after three adblocks. Actually, the AdSenseDeluxe plugin itself prevents more than three from appearing on any one page. It's coded into the PHP. Once the plugin places three adblocks, it simply quits adding them--no matter how many you put. That means that you're free to place them in every single post and let the plugin keep you from violating Google's TOS.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags