【发布时间】:2014-09-03 08:57:23
【问题描述】:
我正在使用引导式 wordpress 设计,并且正在使用一些 PHP 来输出帖子。
但是,使用任何方法,无论是 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,以便我可以为您提供一个工作示例。
-
或者您可以将生成的 html 和 CSS 复制/粘贴到 bootply bootply.com 并找出问题所在。 bootply 是练习引导相关问题的最佳场所。
标签: php css wordpress twitter-bootstrap