Special if statement for main page

Discussion in 'Blogging' started by bschneider5, Aug 6, 2006.

  1. #1
    I have a worpress blog, that I like to have my rectangle ad run on all pages except the home page. (on www.bradsblog.net)

    What code can I add to make this work. I currently do not have a seperate post/main template. Here is my current snippett:

    <?php  get_header(); ?>
    <?php get_sidebar(); ?>
    <hr />
    <!-- google_ad_section_start -->
    
    
    <div id="content">
    <script type="text/javascript"><!--
    google_ad_client = "pub-1725522918851661";
    google_ad_width = 336;
    google_ad_height = 280;
    google_ad_format = "336x280_as";
    google_ad_type = "text_image";
    google_ad_channel ="5657200493";
    google_color_border = "FFFFFF";
    google_color_bg = "FFFFFF";
    google_color_link = "008000";
    google_color_url = "000000";
    google_color_text = "000000";
    //--></script>
    <script type="text/javascript"
      src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
        <?php // Post dates off by default the_date('','<h2>','</h2>'); ?>
        <div id="post-<?php the_ID(); ?>">
        <h2><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>    
        <div class="meta"><?php _e("Posted in"); ?> <?php the_category(',') ?> by <?php the_author() ?> on the <?php the_time('F jS, Y') ?> <?php edit_post_link(__('Edit This')); ?></div>
        <div class="main">
            <?php the_content(__('(more...)')); ?>
        </div>
        </div>
    <!-- google_ad_section_end -->
         <div class="related">
    
    <b><u><h3>Related Posts</h3></b></u><br>
    <?php related_posts(5, 10, '<li>', '</li>', '', '', false, false); ?>
       
          </div> 
          <br>
        <div class="comments">
            <?php wp_link_pages(); ?>
            <?php comments_popup_link(__('<strong>0</strong> Comments'), __('<strong>1</strong> Comment'), __('<strong>%</strong> Comments')); ?>
    Code (markup):
     
    bschneider5, Aug 6, 2006 IP