我正在使用引导带与WordPress。我正在更新一个个人资料页面,显示一个人的图像和他们的标题为文本。我用的是一个简单的循环。有4个配置文件要显示,因此我设置了以下内容:
class="col-xs-6 col-sm-6 col-md-3 col-lr-3"然而,在移动视图xs-6中,所有的东西都显示得很好,第三个配置文件不是在左边,而是在右边,造成了一个空空间。
<?php
/*
Template Name: Committee
*/
?>
<?php get_header(); ?>
<div class="container">
<div id="section" class="clearfix row">
<div class="col-lg-12">
<h1>Committee</h1>
<?php
$temp_query = $wp_query;
query_posts(array(
'category_name' => 'committee',
'orderby' => 'date',
'order' => 'desc',
'paged'=> $paged,
/*'posts_per_page' => 10,*/
'perm'=>'readable'
));
if(have_posts()) : while(have_posts()) : the_post();
?>
<div class="col-xs-6 col-sm-3 col-md-3 col-lg-3" id="artists-gallery">
<a class="profile-img" href="" data-toggle="modal" data-target="#myModal"><img src="<?php the_field('image');?>" alt=""/></a>
<p><?php the_field('name');?></p>
<p><?php the_field('title');?></p>
<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title"><?php the_title();?></h4>
</div>
<div class="modal-body">
<p><?php the_content();?></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div><!--end of artists gallery-->
<?php endwhile;?>
<!--<div class="next-post"><?php next_posts_link('Next >') ?></div>
<div class="prev-post"><?php previous_posts_link('< Previous') ?></div>-->
<?php else : ?>
<p><?php _e( 'Sorry, no pages found.' ); ?></p>
<?php endif; ?>
</div>
</div><!--end of section-->
</div><!--end of container-->
<?php get_footer(); ?>
`.profile-img img {
border-radius: 2.5px;
border: 1px solid #da2777;
margin: 5px 0 5px 0; }
#artists-gallery img {
max-width: 100%;
height: auto; }`全宽lr 3
移动视图xs-6
发布于 2016-07-26 00:55:08
我猜是因为你的档案高度不同。在我看来,配置文件1比配置文件2要高,由于浮动的工作方式,引导网格有点混乱。
您可以通过确保配置文件都是相同的高度来纠正它,或者使用不同的布局工具,比如砖石。
https://stackoverflow.com/questions/38577008
复制相似问题