WordPress Chinese Forums's Archiver

林梦 发表于 2008-10-22 13:51

如何去掉首页的google广告?

index.php的代码如下,应该去掉哪一段阿?
谢谢了

<?php get_header(); ?>
<div id="container">
     <div id="content" class="ihomepage">
        
        <?php if (have_posts()) : ?>
         
            <div id="fir">
            <?php $my_query = new WP_Query('showposts=1');
  while ($my_query->have_posts()) : $my_query->the_post();
  $do_not_duplicate[] = $post->ID; ?>
  
      <div class="thepic">
               
                <div class="fir-cat"><?php the_category(', '); ?></div>
               
            <?php if ( get_post_meta($post->ID, 'pre_image', true) ) : ?>
      <?php $image = get_post_meta($post->ID, 'pre_image', true); ?>
      <img width="160" src="<?php echo $image; ?>" alt="<?php the_title() ?>" />
   <?php else: ?>
                    <img width="160" src="<?php bloginfo('template_directory'); ?>/images/blank.jpg" />
            <?php endif; ?>
             </div><!--.thepic-->
   
         <div id="post-<?php the_ID(); ?>" class="post">
            
                <h2 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Links to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
               
               <small><?php the_time('Y-m-d'); ?> | <?php the_author_posts_link(); ?> | <?php comments_popup_link('No Comment','One Comment','% Comments'); ?><?php edit_post_link(' | Edit'); ?></small>
               
                <div class="entry-content"><?php the_excerpt(); ?></div>
               
                <div class="entry-meta"><?php if (function_exists(akst_share_link)) {akst_share_link();} ?><span><a class="more-link" href="<?php the_permalink(); ?>" title="Go to <?php the_title(); ?>">Read the rest &raquo;</a></span></div>
              
            </div><!--.post-->
         <?php endwhile; ?>
            <div class="iclear"></div>
            </div><!--#fir-->
            
            <div id="ad468px">
             <div class="contact"><a href="/contact-me/">Contact</a></div>
                <div class="adsense">
                 <script type="text/javascript"><!--
      google_ad_client ="pub-0068523624396312";
      /* 468x60, �ǵ���������Google�ͻ��ţ����硰"pub-0068523624391234"�� */
      google_ad_slot = "9458502323";
      google_ad_width = 468;
      google_ad_height = 60;
      //-->
      </script>
      <script type="text/javascript"
      src="[url=http://pagead2.googlesyndication.com/pagead/show_ads.js]http://pagead2.googlesyndication.com/pagead/show_ads.js[/url]">
     </script>
                </div>
             <div class="iclear"></div>
            </div><!--#ad468px-->
            
            <div id="sec">
            
           <?php if (have_posts()) : while (have_posts()) : the_post(); if($post->ID == $do_not_duplicate[0]) continue; update_post_caches($posts); ?>
    <div id="post-<?php the_ID(); ?>" class="post">
       <h2 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Links to <?php the_title_attribute(); ?>"><?php sofished_ititle(); ?></a></h2>
               
                <small><?php the_time('Y-m-d'); ?> | <?php the_author_posts_link(); ?> | <?php comments_popup_link('No Comment','One Comment','% Comments'); ?><?php edit_post_link(' | Edit'); ?></small>
               
                <div class="entry-content">
                <div class="thepic">      
            <?php if ( get_post_meta($post->ID, 'pre_image', true) ) : ?>
      <?php $image = get_post_meta($post->ID, 'pre_image', true); ?>
      <img width="60" src="<?php echo $image; ?>" alt="<?php the_title() ?>" />
   <?php else: ?>
                    <img width="60" src="<?php bloginfo('template_directory'); ?>/images/blank.jpg" />
            <?php endif; ?>
             </div><!--.thepic-->
     <?php sofished_excerpt(); ?>
     
                </div><!--.entry-content-->
      </div><!--.post-->
     <?php endwhile; endif; ?>
            <div class="whitespace"></div>
            </div><!--#sec-->
            
            <div class="navigation">
    <?php wp_pagenavi(); ?>
                <div class="iclear"></div>
            </div>
            
  <?php else : ?>
            
             <h2 class="entry-title">Not Found</h2>
             <p>Sorry, but what you are looking for isn't here...</p>
             <?php include (TEMPLATEPATH . "/searchform.php"); ?>
            
        <?php endif; ?>   
        </div><!--#content-->
    </div><!--#container-->
   
<?php get_sidebar(); ?>
<?php get_footer(); ?>

scutdk 发表于 2008-10-22 14:18

<div id="ad468px">
             <div class="contact"><a href="/contact-me/">Contact</a></div>
                <div class="adsense">
                 <script type="text/javascript"><!--
      google_ad_client ="pub-0068523624396312";
      /* 468x60, �ǵ���������Google�ͻ��ţ����硰"pub-0068523624391234"�� */
      google_ad_slot = "9458502323";
      google_ad_width = 468;
      google_ad_height = 60;
      //-->
      </script>
      <script type="text/javascript"
      src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
     </script>

林梦 发表于 2008-10-22 17:12

可是这样改了以后,本来往下排的文章成了往右排的勒

wozhuanqian 发表于 2008-10-22 18:08

谁的广告?
为什么要去掉呢?

scutdk 发表于 2008-10-22 18:42

回复 3# 的帖子

那是肯定的啊
本来那个广告就是插入在那里的

plzon 发表于 2008-10-22 22:43

換成你自己的AdSense廣告......

页: [1]

Powered by Discuz! Archiver 7.0.0  © 2001-2009 Comsenz Inc.