横並びに交互に並べた投稿のループ
-
質問させてください。
現在、以下のような形でループを作成しています。<?php if(have_posts()) : while (have_posts()) : the_post(); ?> <table class="seeTbl" cellspacing="0"> <tr valign="top"> <!--左--> <td width="80"><?php $image1 = post_custom('写真'); echo wp_get_attachment_image( $image1,'thumbnail' ); ?></td> <td valign="top" width="250"> <a href="detail.html"><?php the_title();?></a><br /> <?php the_content();?></td> <!--左--> <td><img src="/images/spacer.gif" width="10" height="1"></td> <!--右--> <td width="80"><?php $image1 = post_custom('写真'); echo wp_get_attachment_image( $image1,'thumbnail' ); ?></td> <td valign="top" width="250"> <a href="detail.html"><?php the_title();?></a><br /> <?php the_content();?></td> <!--右--> </tr> </table> <?php endwhile; endif; ?>
上記を実行しますと、当然なのですが左も右も同じ投稿の内容が表示されて、ループしてしまいます。
これを左右に別々の投稿を表示しながらループさせていくにはどうしたら良いのでしょうか?
イメージとしましては、1 2
3 4
5 6
7 8
.
.↑このように交互に順番に表示していきたいと思っています。
良い解決法をご存知の方がいらっしゃいましたらご教授ください。
よろしくお願いします。
2件の返信を表示中 - 1 - 2件目 (全2件中)
2件の返信を表示中 - 1 - 2件目 (全2件中)
- トピック「横並びに交互に並べた投稿のループ」には新たに返信することはできません。