Twitter引导跨越在动态网站 [英] Twitter bootstrap spans in dynamic websites
本文介绍了Twitter引导跨越在动态网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我应该如何使用CMS(如WordPress)生成动态行?
How am I supposed to generate dynamic rows with a CMS like WordPress?
<div class="row-fluid">
<div class="span6"></div>
<div class="span6"></div>
<div class="span6"></div>
<div class="span6"></div>
</div>
这不工作。
<div class="row-fluid">
<div class="span6"></div>
<div class="span6"></div>
</div>
<div class="row-fluid">
<div class="span6"></div>
<div class="span6"></div>
</div>
这是可行的,但是我应该如何编程行的后端?
This works but how am I supposed to program the back-end for the rows?
推荐答案
嗯,你没有足够的描述你想做什么,所以我假设你正在循环通过帖子,并将它们都存储在 $ posts
变量中,并且html位于每个 content
c $ c> $ post 这基本上是我可以给你的唯一方向:
Umm, you don't have nearly enough description of what you are trying to do, so I'll assume you are looping through posts, and have them all stored in the $posts
variable, and that the html is in the content
property of each $post
this is basically the only direction I can give you:
$i=0;
foreach ($posts as $post):
if ($i%2==0) echo '<div class="row-fluid">';
echo '<div class="span6">'. $post->content .'</div>';
if ($i%2==1) echo '</div>';
$i++;
endforeach;
这篇关于Twitter引导跨越在动态网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文