Forum Moderators: martinibuster

Message Too Old, No Replies

Adsense unit clickable but not visible

in IE6, one adsense unit is clickable, but invisible

         

Web2Guru

1:01 am on Apr 5, 2008 (gmt 0)

10+ Year Member



I've looked all over and can't figure out why this one unit is having this weird problem. You can put the mouse over where the ads are supposed to be and it changes to the little pointing hand and you can click and it will follow the ad, but the ad unit is completely invisible. However, all of the other AdSense ads on the same page show up with out a problem.

It is not my computer as it's been tested from two others here and two others at another location. As far as I know, this bug is only in IE6. I'm not sure about IE7, but Firefox2 displays it fine.

This unit is on a WordPress blog using a modified Cordobo Green theme. I enclose the ad in div tags on the index page of the theme, floated to the right at the top of the first post. This is in TheLoop directly after the #main div opening tag. It's a 250x250 text/picture AdSense For Content block. I set the div size to 250x250 and even tried 251x251 and that didn't fix it. Again, this works fine in Firefox, but not IE6, not sure on IE7.

Another thing I noticed in my testing, when viewing source from the browser, Firefox has an iFrame right after the last AdSense JavaScript call. In IE this iFrame is not there.

This ad is in a key area and as IE6 is (unfortunately) the most popular browser, this is big problem. Any help is greatly appreciated.

cgiscripts4u

9:48 am on Apr 5, 2008 (gmt 0)

10+ Year Member



Could this be a div problem surrounding the adsense code? I have seen many times when a </div> has been left out for instance, the div contents still show OK in firefox but not in IE.

greatstart

3:07 pm on Apr 5, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You should use an HTML validation program to check your pages. I think you'll find the error(s) when you do it.

Web2Guru

8:15 pm on Apr 5, 2008 (gmt 0)

10+ Year Member



The closing div tag is there and the page validates XHTML 1.0 Transitional and CSS2.1 using the W3C validators.

Is it ok to post a link here to the my site without violating TOS?

Web2Guru

2:58 am on Apr 7, 2008 (gmt 0)

10+ Year Member



Well I've narrowed the problem down to the theme. I turned all the plugins off and had the same problem. Turned them back on. Made the same changes in the default theme and it loads the adsense unit properly. So by process of elimination, that makes the theme the problem. I also know it's not any of the other mods I've made because it doesn't work properly in the original theme files either.

Here's my stylesheet: [thegadgitech.com...]

Here's is my wordpress loop (with some unrelated content hidden):
sorry, the tabs were stripped

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

<div class="entry<?php if(is_home() && $post==$posts[0] && !is_paged()) echo '_firstpost';?>">
<div class="latest<?php if(is_home() && $post==$posts[0] && !is_paged()) echo '_firstpost';?>">

<h2 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>

<div class="meta<?php if(is_home() && $post==$posts[0] && !is_paged()) echo ' firstpost';?>">
<?php _e("Posted on "); ?> <?php the_time('F jS, Y') ?> in <?php the_category(',') ?> by <?php the_author() ?> <?php edit_post_link('Edit', ' ¦ ', ''); ?>
</div>

<div class="main">
<?php if(is_home() && $post==$posts[0]) { ?>
<div id="topPostAdsense">
<!--GoogleAdsForContent TextAdUnits Begin-->
<script type="text/javascript"><!--
Google code here (hidden)//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<!--GoogleAdsForContent TextAds End-->
</div>
<?php } ?>

<?php the_content(''); ?>

<?php wp_link_pages(); ?>

<ul class="readmore">
<li>readmore section/post footer (hidden)</li>
</ul>

</div>

<!--
<?php trackback_rdf(); ?>
-->
</div>
</div>

<?php comments_template(); ?>

<?php endwhile; else: ?>

<div class="warning">
<p><?php _e('Sorry, no posts matched your criteria, please try and search again.'); ?>
<?php include (TEMPLATEPATH . '/searchform.php'); ?></p>
</div>

<?php endif; ?>

iridiax

6:35 am on Apr 7, 2008 (gmt 0)

10+ Year Member



I looked at your source code, and you have two divs with the same id="topPostAdsense", which will cause validation to fail. Something is causing a doubling of the topPostAdsense div in your code.

IE 6 has box model problems, and I'm guessing that your problem may also be related to this.

Web2Guru

4:12 pm on Apr 7, 2008 (gmt 0)

10+ Year Member



sorry, you got to it while I was testing. I copied the code and put it at the bottom of the page, just outside the loop. And it displays properly there. If you scroll down to the bottom, you'd see the ad below all the posts at the bottom of the page. But I've since removed that code, it was just to test and narrow down the problem, which seems to be something the theme is doing in the loop, but not outside the loop.

Web2Guru

7:45 pm on Apr 11, 2008 (gmt 0)

10+ Year Member



Got it down to a float problem. If I remove the float: right; statement, the ad is visible in IE6. But I really need the ability to float it to the right so the text content flows around it. Could adding a position: relative; statement to the parent div have any affect on floating elements? I will test that idea later.

Otherwise, I think I may go back to putting the adsense directly in the post - it floats fine there (or at least it used to on another theme). It's a little more work to keep up with, but then I can put the ad anywhere, not just the top-left or -right corner.