Support » Fixing WordPress » Adsense ads not displaying correctly in posts

  • Hello,

    I am having a strange problem when I include ads in my posts. The entire ad shows up, but so does about a quarter-inch yellow strip. This doesn’t happen in the side bar, only in posts. You can see the problem on this post.

    If anyone has any suggestions on how to fix this, It would be greatly appreciated.


Viewing 10 replies - 1 through 10 (of 10 total)
  • I added

    ins {
    background: none;

    to my css style and it made the yellow disappear, but the extra spacing is still there.

    Are you inserting ads by editing theme files or using a plugin? The extra space is because of the incorrect height and width that you specified for the space where ads are inserted.

    I am just pasting the adsense code into the text of my posts at this point.

    Does anyone have any idea how I can go about fixing this? I still have probably 100 pixels of extra space appearing before the adds within my posts. I am just pasting the code provided by google into the posts.

    I don’t see any ads – just a blank space, yes. Looks like there is inline CSS creating the space – so change that and/or use a browser tool like Firebug to look at the CSS to see what code to change.

    Moderator Andrew Nevins


    Front-end developer

    Did you try that margin reduction in the iframe?

    The ads don’t appear to be using an iframe. Here is the ad code:

    <script type="text/javascript">// <![CDATA[
    google_ad_client = "ca-pub-1309469874351592"; /* Sidebar Ad */ google_ad_slot = "1935785068"; google_ad_width = 250; google_ad_height = 250;
    // ]]></script>
    <script type="text/javascript" src="">// <![CDATA[
    // ]]></script>

    I don’t have the odd spacing issue in the sidebar when I use the same code, only in posts and pages. I am new to wordpress and I haven’t worked with html for about 5 years so I could be missing something obvious.

    Which ad are you talking about – this is the code in your post:

    <ins id="aswift_0_anchor" style="display:block;border:none;height:250px;margin:0;padding:0;position:relative;visibility:visible;width:250px">
    <iframe id="aswift_0" width="250" scrolling="no" height="250" frameborder="0" style="left:0;position:absolute;top:0;" name="aswift_0" onload="var,s=window.google_iframe_oncopy,H=s&&s.handlers,h=H&&H[i],w=this.contentWindow,d;try{d=w.document}catch(e){}if(h&&d&&(!d.body||!d.body.firstChild)){if({setTimeout(h,0)}else if(h.match){w.location.replace(h)}}" allowtransparency="true" hspace="0" vspace="0" marginheight="0" marginwidth="0">

    I am talking about the ad highlighted red and the extra space shown in yellow.

    I have searched through the page source for the post and I don’t see the code you pasted anywhere, only the code I pasted. I am just selecting “view page source” in my browser, should I be using a different tool?

    I simply used Firebug and copied the code for that ad…

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Adsense ads not displaying correctly in posts’ is closed to new replies.