我的网站是职业追踪器
我想设计像按列 2 列的 wordpress
像这样
post1 post2
post3 post4
post5 post6
知道如何在 wordpress 中制作这个...吗?
我知道简单的方法
query_posts('category_name=Bank Jobs&showposts=10');
while (have_posts()) : the_post();
{
}
但我想在两列中显示结果。
$count = 0;
<?php if (have_posts()) : while (have_posts()) : the_post(); ?> // this is your loop
if($count == 2){ // here is the condition that when the count comes to 2 it will break th e line
echo '</div><div class="right">'; $count = 0;
}
echo $post->post_content(); // printing the content of post
$count++;
<?php endwhile; endif; ?>