这是Wordpress循环
<div class="section-title">
<h1>Most Recent Post</h1>
</div>
<div id="recent-post-carousel" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#recent-post-carousel" data-slide-to="0" class="active"></li>
<li data-target="#recent-post-carousel" data-slide-to="1"></li>
</ol>
<div class="carousel-inner">
<?php
// Get posts (tweak args as needed)
$i=0;
$args = array(
'post_type' => 'post',
'posts_per_page' => -1,
'orderby' => "date",
'order' => "desc"
);
$posts = get_posts( $args );
?>
<?php foreach (array_chunk($posts, 4, true) as $posts) : ?>
<div class="item <?php if ($i==0){echo 'active';}?>">
<div class="row">
<?php foreach( $posts as $post ) : setup_postdata($post); ?>
<div class="col-sm-6">
<div class="single-post">
<div class="pull-left post-image">
<a href="#">
<?php the_post_thumbnail( 'full' ); ?>
<i class="fa fa-angle-right"></i>
</a>
</div>
<div class="pull-right post-details">
<p class="post-date">03 Dec 2014</p>
<p><?php echo $i?></p>
<a href="#"><h5><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a>
</h5></a>
<span>John doe</span>
<p><?php echo substr(get_the_excerpt(), 0,99).' [...]'; ?></p>
</div>
</div>
</div>
<?php $i++ ?>
<?php endforeach; ?>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
</div>
不确定它是否与wordpress有关,我在静态页面上尝试过它并且运行正常。修复它的一种方法是从col-sm-6中删除左边距或右边距,但我认为这不是一种好办法。
答案 0 :(得分:0)
我为你创造了一个小提琴。上面提到了一个是你的情况,下面的一个是最小高度的案例(已解决)。
**https://jsfiddle.net/Anuj_Kumar/L5uduxLr/1/embedded/result/**
如果仍然没有修复,请尝试添加“cleafix”类和“single-post”。