WordPress.org

Ready to get started?Download WordPress

Forums

Adsense ads not displaying correctly in posts (11 posts)

  1. PersuasiveAuthority
    Member
    Posted 1 year ago #

    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.

    Best.

  2. PersuasiveAuthority
    Member
    Posted 1 year ago #

    I added

    ins {
    background: none;
    }

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

  3. Krishna
    Volunteer Moderator
    Posted 1 year ago #

    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.

  4. PersuasiveAuthority
    Member
    Posted 1 year ago #

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

  5. PersuasiveAuthority
    Member
    Posted 1 year ago #

    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.

  6. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    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.

  7. Andrew
    Forum Moderator
    Posted 1 year ago #

    Did you try that margin reduction in the iframe?

  8. PersuasiveAuthority
    Member
    Posted 1 year ago #

    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="http://pagead2.googlesyndication.com/pagead/show_ads.js">// <![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.

  9. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    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 i=this.id,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(h.call){setTimeout(h,0)}else if(h.match){w.location.replace(h)}}" allowtransparency="true" hspace="0" vspace="0" marginheight="0" marginwidth="0">
    </ins>
  10. PersuasiveAuthority
    Member
    Posted 1 year ago #

    I am talking about the ad highlighted red and the extra space shown in yellow.
    http://i46.tinypic.com/dtsi9.jpg

    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?

  11. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.