【发布时间】:2014-07-21 15:41:04
【问题描述】:
<?php while(have_posts()) : the_post() ?>
<?php global $post;
$loop = new WP_Query( array( 'posts_per_page' => 20 ) );
while ( $loop->have_posts() ) : $loop->the_post();
if ( has_post_thumbnail()) {
the_post_thumbnail();
}
<?php endwhile; ?>
<?php endwhile;?>
<?php endif ; ?>
上述代码用于检索特征图像,问题: 如何在不同的引导网格中显示 wordpress 帖子,如下图所示:
第一个帖子像我标记的大一个 (1) 第二个帖子像我标记的这个图像 (2) 第三个帖子就像我标记为 (3) 的这张图片,第四个帖子也是如此。
请大家多多指教..
我在引导程序中做到了这一点:
<div class="row" style="width:100%;height:460px;">
<div class="col-xs-6" >
<div class="row">
<div class="col-xs-12" style="background:#F90;height:460px;">
</div>
</div>
</div>
<div class="col-xs-6">
<div class="row">
<div class="col-xs-12" style="background:#333;height:230px;"></div>
</div>
<div class="row">
<div class="col-xs-6" style="background:#933;height:230px;"></div>
<div class="col-xs-6" style="background:#093;height:230px;"></div>
</div>
</div>
</div>
如何将它们混合在一起?
【问题讨论】:
-
修改您的循环以跟踪您正在输出的帖子,并在每个阶段转储出适当的 html...
-
@MarcB 我需要你的帮助..请帮帮我
-
为什么要在主循环中运行自定义循环。为什么要使用全局变量
-
@PieterGoosen 我刚刚在 google 中找到了这段代码。还有什么办法吗?
标签: jquery css wordpress twitter-bootstrap