WordPress.org

Forums

[resolved] Twenty Ten Theme - TextScrolling round Google Ads (4 posts)

  1. technonow
    Member
    Posted 4 years ago #

    I'm using WordPress 3.0 and a child theme based on the default twenty ten theme.

    On my page.php I've coded in a google ad and I was expecting the text to scroll round it, but it isn't. I don't want to use a Plugin.

    Knowing me, I'm probably missing something obvious!

    Can anyone please help by telling me what I've done wrong?

    My site is at http://funeral-poems.net/ and my page.php code is as follows:

    <div id="container">
    	<div id="content" role="main">
    
    <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
    
    <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    	<?php if ( is_front_page() ) { ?>
    		<h2 class="entry-title"><?php the_title(); ?></h2>
    	<?php } else { ?>
    		<h1 class="entry-title"><?php the_title(); ?></h1>
    	<?php } ?>				
    
    	<div class="entry-content">
    
    	<div id="googleads" style="float:right;margin:12px;">
    		<script type="text/javascript"><!--
    		google_ad_client = "pub-xxxxxxxxxx";
    		/* 250x250 top square, created 6/21/10 */
    		google_ad_slot = "0905491855";
    		google_ad_width = 250;
    		google_ad_height = 250;
    		//-->
    		</script>
    		<script type="text/javascript"
    		src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    		</script>
    	</div>
    
    	<?php the_content(); ?
    	<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
    	<?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?>
  2. technonow
    Member
    Posted 4 years ago #

    Strange. On some pages the text is scrolling correctly, whilst on others it isn't!

  3. alchymyth
    Forum Moderator
    Posted 4 years ago #

    those articles, where it does not work, start with a h3 title.

    this style in style.css of the theme seems responsible:

    h1, h2, h3, h4, h5, h6 {
    	font-weight: normal;
    	clear: both;
    }

    the 'clear:both;' stops the title from being affected by 'floating' divs.

    taking h3 out of this style soves your problem.

    however, these styles might be there for a good reason (or maybe not), and changing them could have side effects somewhere else on the site, or in certain situations.

  4. technonow
    Member
    Posted 4 years ago #

    Thanks for that. Just what I needed to know. Much obliged.

    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic