0

我所有的帖子都显示在同一个 div 中,而不是单独的,

<?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 来阻止这种情况发生?

谢谢

4

1 回答 1

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; ?>
于 2013-06-24T21:03:09.630 回答