2013-06-24 20 views
0

所有我的帖子都出現在同一格,而不是單獨的人表示,帖子在同一格的WordPress

<?php get_header(); ?> 
<div class="mainwrap"> 
<div class="bloginner"> 
<!-- begin section -->   

<section> 
    <div class="postswrap"> 
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?> 
    <div class="commentsetall"><img src="<?php bloginfo('template_url'); ?>/images/ico_folder.png" alt="Posted" /><span class="commentfix"><?php the_time('F j, Y') ?> in <?php the_category(', ') ?> by <?php the_author() ?></span></div> 
    <h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1> 
    <?php endwhile; else: ?> 
    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p> 
    <?php endif; ?> 
    <div class="clearfix"></div> 
    </div> 

</section> 
<!-- end section --> 
</div> 
<div class="clearfix"></div> 
</div> 
<?php get_footer(); ?> 

是否有clearfix IM也許缺少阻止這種情況發生?

感謝

+0

嘗試把postswrap格內循環。或者在結束之前把明確的定位放在循環中; – Matt

回答

3

<div class="postswrap">的loop.something喜歡裏面:

 <?php if (have_posts()) : while (have_posts()) : the_post(); ?> 
<div class="postswrap"> 
     <div class="commentsetall"><img src="<?php bloginfo('template_url'); ?>/images/ico_folder.png" alt="Posted" /><span class="commentfix"><?php the_time('F j, Y') ?> in <?php the_category(', ') ?> by <?php the_author() ?></span></div> 
     <h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1> 
     <?php endwhile; else: ?> 
     <p><?php _e('Sorry, no posts matched your criteria.'); ?></p> 
<div class="clearfix"></div> 
     </div>   
<?php endif; ?> 
+0

謝謝你......怪不得要精神了!謝謝 :) –