2010-10-04 16 views
0

在我的一个wordpress模板中,内容代码似乎让子页面菜单不显示在边栏中。当我删除内容div中的所有代码时,子菜单按预期显示。WP - 内容代码让子页面不会出现在边栏中

任何人都可以指出代码出错的地方吗?

任何帮助将不胜感激!

<div id="content"> 

     <div class="pageinfo clearfix"> 
    <div class="info"> 
    <h1><?php the_title();?></h1> 
    </div> 
</div> 

     <?php 
      global $more; 
      // set $more to 0 in order to only get the first part of the post 
      $more = 0; 
      global $post; 
      $myposts = query_posts("category_name=intern&posts_per_page=3"); 
      foreach($myposts as $post) : 
      setup_postdata($post); 
     ?> 
     <div class="postitem clearfix"> 
      <div class="new"></div> 
      <div class="info"> 
       <h2><a href="<?php the_permalink()?>"><?php the_title()?></a></h2> 
       <?php the_date()?> | Skrevet af <?php the_author_posts_link(); ?> | Gemt under: 
       <?php 
       // heres just the name and permalink: 
       foreach((get_the_category()) as $category) { 
        $category_name = $category->category_nicename . ' '; 
        $category_link = get_category_link($category->cat_ID); 
        echo "<a href='$category_link'>$category_name</a>"; 
       } 
       ?> 
      </div> 
       <?php 
       $thumb = get_post_meta($post->ID,'_thumbnail_id',false); 
       $thumb = wp_get_attachment_image_src($thumb[0], false); 
       $thumb = $thumb[0];?> 

       <?php if($thumb != NULL) { ?> 
        <a href="<?php the_permalink() ?>"> 
        <img src="<?php bloginfo('template_directory'); ?>/scripts/timthumb.php?src=<?php echo $thumb ?>&h=110&w=110&zc=1" alt="<?php the_title(); ?>" width="110" height="110" class="leftImage" > 
        </a> 
       <?php } ?> 

       <?php the_content('<br />Læs resten her » '); ?> 
       <div class="clearBoth"></div> 



     </div><!-- /postitem --> 
     <?php endforeach; ?> 


    </div><!-- /content --> 

回答

0

尝试rewind_posts();wp_reset_query();侧边栏加载在什么地方了(和endforeach后)。