【发布时间】:2016-05-08 20:15:47
【问题描述】:
我想在我的 wordpress 页面上创建类似 3 行的帖子,然后水平开始另一行,所以我使用 bootstrap 完成了它,前 3 个帖子看起来不错,但是当下一行开始时,有很大的空白空间在行之间,它的外观:
http://i.stack.imgur.com/XxQbI.png
我的后循环代码:
<?php get_header(); ?>
<div id="content">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<article class="col-xs-6 col-md-4" id="post-<?php the_ID(); ?>" <?php post_class(); ?> >
<?php
if(!get_post_format()) {
//Display the Post Image by default
get_template_part( "post_image", "index" );
} else {
get_template_part('format', get_post_format());
}
?>
<div class="post-inside container-fluid">
<div class="row">
<div class="post-content">
<?php the_title( sprintf( '<h2 class="post_title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>
<div class="entry">
<?php the_content(); //Read more button is in framework/functions/single_functions.php?>
<div class="clearfix"></div>
</div>
<div class="clearfix"></div>
</div><!-- /post_content -->
</div><!-- /row -->
</div><!-- /post-inside -->
<div class="clearfix"></div>
</article>
<?php endwhile; ?>
<div class="clearfix"></div>
<?php get_template_part( "pagination", "index" ); ?>
<?php else : ?>
<?php get_template_part( "/templates/content-none", "index" ); ?>
<?php endif; ?>
Pastebin:http://pastebin.com/Fw5rcfmh
这段代码有什么问题?
【问题讨论】:
标签: php wordpress twitter-bootstrap