WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] AdSense Not Displaying (2 posts)

  1. tasty.donuts
    Member
    Posted 3 years ago #

    Really weird bug where my site (triggla.tv) does not display the AdSense code on the homepage in FireFox or Chrome, and in FireFox has a weird glitch with AdSense where it tries to load the wrong banner size into the box (but corrects itself upon reset): http://i.imgur.com/py17r.png

    I am just using the adsense code -- no plugin. Do I need to use Plugin?

    <div class="adsense"><script type="text/javascript"><!--
    google_ad_client = "ca-pub-#################";
    /* TrigglaTV Square */
    google_ad_slot = "################";
    google_ad_width = 250;
    google_ad_height = 250;
    //-->
    </script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script></div>

    This happened with the last version of WordPress as well (it's not just a 3.1 issue I mean).

    Can you tell me why this isn't displaying correctly?

  2. tasty.donuts
    Member
    Posted 3 years ago #

    Ok this is so simple I could kick myself, so if you have the following problem:

    The AdSense boxes in the posts were registering on the homepage even though I had removed them with CSS. So, in order to fix this I added <?php if(is_single()): ?> to the AdSense code in my loop (since I didn't want them on the homepage anyway) and voila.

Topic Closed

This topic has been closed to new replies.

About this Topic