Quick code fix, please

3 replies
  • WEB DESIGN
  • |
Hi guys

Just wondering if anyone can help me quickly and fix my coding. I just tried adding an adsense unit to the top of Natural Health Blog | Natural Detox, Anti-Aging, Beauty & Weight Loss Tips & Secrets

Obviously I took something out and now the text continues right across the page. If this could be amended that would be much appreciated.

And also if an adsense ad with this code could be added above the heading of the blog post "Bee Therapy (AKA Apitherapy)"

Adsense code:

<script type="text/javascript"><!--
google_ad_client = "pub-5141259668140493";
/* RYH Top */
google_ad_slot = "2683954320";
google_ad_width = 180;
google_ad_height = 150;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

==========================


Here is the current code for the page:

=================================

<?php
get_header();
?>
</div>

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

<div class="post" id="post-<?php the_ID(); ?>">

<h3 class="storytitle"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
<div class="date"><?php the_date()?></div>

<div class="storycontent">
<?php the_content(__(' ...read the rest of this post')); ?>
<br />
<p><?php if (get_the_tags()) the_tags('Tagged with: ',' &bull; ',''); ?> </p>
</div>

<?php if (!is_single()) :?>
<div class="feedback">
<a href="<?php the_permalink() ?>#postcomment"><?php comments_number(__('no comments yet'), __('1 comment'), __('% comments')); ?> to <?php the_title(); ?></a>
</div>
<?php endif;?>

</div>

<?php comments_template(); // Get wp-comments.php template ?>

<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>

<div id="pnl"><?php posts_nav_link(' — ', __('&laquo; Previous Page'), __('Next Page &raquo;')); ?> </div><script type="text/javascript" src="http://forms.aweber.com/form/11/1873564811.js"></script>

<?php get_footer(); ?>

===========================


If anyone could fix the code and add the adsense code it would be much appreciated.

Thanks so much

James Penn
#code #fix #quick
  • Profile picture of the author Darren Mothersele
    Take out that first end div (</div>) after get_header()

    The firefox extension called Firebug is your friend at times like this.

    in the generated code, this...

    Code:
    <div id="container">
    <div id="content">
    <!-- end header -->
    </div>
    needs to look like this...

    Code:
    <div id="container">
    
    <div id="content">
    <!-- end header -->
    {{ DiscussionBoard.errors[375836].message }}
  • Profile picture of the author Shadi
    i cant see the error, but it thing its fixed?
    But if its still there on some browsers I will need to see the header code its included from header.php in the header function above
    {{ DiscussionBoard.errors[379833].message }}
  • Profile picture of the author JamesPenn
    Thanks a lot Darren for the help. I've managed to fix it now and add the adsense code.

    James
    {{ DiscussionBoard.errors[380295].message }}

Trending Topics