我正在使用bootstrap wordpress设计,并且我使用一些PHP来输出帖子。bootstrap 3/4列的第二行之后的第三行破解
然而,无论是col-3,col-4还是col-2,我都会得到一个单独的投资组合项目,然后正确的列将返回。
这里是我的代码:
<article id="post-<?php the_ID(); ?>" <?php post_class('col-lg-4 col-sm-4 pbox'); ?>>
<?php
$thumb = get_post_thumbnail_id();
$img_url = wp_get_attachment_url($thumb,'full'); //get full URL to image (use "large" or "medium" if the images too big)
$image = aq_resize($img_url, 720, 560, true); //resize & crop the image
?>
<?php if($image) : ?>
<a href="<?php the_permalink(); ?>"> <img class="img-responsive" src="<?php echo $image ?>"/></a>
<?php endif; ?>
<h2 class="box-title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<div class="box-meta"><?php the_category(', '); ?></div>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
这里是我的问题的图形示例: - http://i.stack.imgur.com/xMFQY.png
附加CSS:
.pbox{margin-bottom: 30px;}
感谢您的帮助!
回答你的问题如果你想得到更详细的帮助,请发布你的PHP代码生成的HTML,以便我可以提供给你以一个工作示例 – Fizzix 2014-09-03 00:57:22
或者您可以将生成的html和CSS复制/粘贴到bootply http ://www.bootply.com/并找出错误的地方。 bootply是练习引导相关问题的最佳场所。 – Raf 2014-09-03 00:58:54