-4

私のウェブサイトはキャリアトラッカーです

wordpressをカラムワイズ2カラムのようにデザインしたい

このような

post1     post2

post3     post4

post5     post6

これを作成する方法はありますか...ワードプレスで??

簡単な方法を知っている

 query_posts('category_name=Bank Jobs&showposts=10');

 while (have_posts()) : the_post();
 {

 }

しかし、結果を2列に表示したい。

4

1 に答える 1

0
    $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; ?>
于 2013-06-27T09:53:27.123 に答える