Wordpressメモ
基本中の基本/ループ処理
とりあえず、これおぼえときゃなんかできる。
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
・
・
・
(処理)
・
・
・
<?php endwhile; else: ?>
<?php endif; ?>
使用例
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<h2><?php the_title(); ?></h2>
<?php the_content(); ?>
<?php endwhile; else: ?>
<?php endif; ?>
| Print article | This entry was posted by タジフ@admin on 2007 年 12 月 14 日 at 2:32 PM, and is filed under WordPress. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |