【问题标题】:Wordpress: How to clear bootstrap columns in loopWordpress:如何清除循环中的引导列
【发布时间】:2016-02-12 04:36:11
【问题描述】:

我使用的是 Wordpress 引导主题,但在清除每一行后都遇到了问题。有些列没有被清除,所以它们之间有空格。

这是我用来显示我的自定义帖子类型“电影”的代码

<?php 

//Define your custom post type name in the arguments

$args = array('post_type' => 'movie', 'posts_per_page'=>'100', 'order'=>'ASC') ;

//Define the loop based on arguments

$loop = new WP_Query( $args );

//Display the contents

while ( $loop->have_posts() ) : $loop->the_post();
?>
<div class="col-lg-3 col-md-3 col-sm-4 col-xs-6" style="padding-bottom:20px;"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_post_thumbnail( 'movie-poster' );  ?></a><?php the_title(); ?><br><em><?php the_date(); ?></em></div>
<?php endwhile;?>

我相信我需要在每 4 次、3 次或 2 次(取决于屏幕)发布后清除它。如何将其添加到上面的代码中?

【问题讨论】:

    标签: wordpress twitter-bootstrap twitter-bootstrap-3


    【解决方案1】:

    我认为您正在寻找帖子的网格布局。检查这个问题:Wordpress Loop posts in Bootstrap 3 grid layout

    【讨论】:

      猜你喜欢
      • 2015-09-03
      • 2018-05-23
      • 1970-01-01
      • 1970-01-01
      • 2017-09-16
      • 2020-12-03
      • 1970-01-01
      • 2016-08-13
      • 2015-05-04
      相关资源
      最近更新 更多