The MU forums have moved to WordPress.org

adsense banner under first post only? (11 posts)

  1. tomte
    Member
    Posted 16 years ago #

    how do i put an adsense banner under the first post only on every wpmu blog?

  2. drmike
    Member
    Posted 16 years ago #

    The same way you do with regular wordpress:

    http://www.tamba2.org.uk/wordpress/adsense/

  3. tomte
    Member
    Posted 16 years ago #

    Great ty, adsense worked fine, but with some other ad-distributor I have a problem, theres is ' ' in the ad-code so I just get errors?

  4. lunabyte
    Member
    Posted 16 years ago #

    Ask the plugin author.

  5. tomte
    Member
    Posted 16 years ago #

    no php interpret the ' in the ad-code as the end of the text php is supposed to echo.. thats the problem..

  6. lunabyte
    Member
    Posted 16 years ago #

    Well, it's an adsense plugin, so you need to be talking to the plugin author for support.

  7. newspartner
    Member
    Posted 16 years ago #

    Example : http://www.hitnews.net main page

    code :
    -------------------------------------------
    <?php $postcount++; if($postcount==1){?> <div>

    Adsense Code

    </div> <?php } ?>

  8. drmike
    Member
    Posted 16 years ago #

    Which is discussed at the link given above.

  9. tomte
    Member
    Posted 16 years ago #

    no drmike, that link you gave works great for adsense, but not for ad-code which includes both " ' ; in the ad-code itself.

    the solution, (worked for me)
    replace every " with \"

    $ad-code = " strange-ad-code ";

    then echo $ad-code;
    instead of echo 'ad-code';

  10. decarn
    Member
    Posted 16 years ago #

    The code works fine, but my first ads are always irrelevant. Only after when I click on the post will the ads change to something more relevant. I think it has something to do with my meta tags. Any ideas?

  11. indeepdark
    Member
    Posted 16 years ago #

    <!-- google_ad_section_start -->
    
    <!-- google_ad_section_end -->

    https://www.google.com/adsense/support/bin/answer.py?answer=23168

About this Topic

  • Started 16 years ago by tomte
  • Latest reply from indeepdark