12 月 25

Wordpressで特定の記事の一覧を出す方法。
get_posts()で特定のカテゴリ情報を取得。

(以下はリスト形式の例)

<ul>
<?php
$catpost = get_posts(’category=3′);
foreach($catpost as $post) :
?>
    <li><a href=”<?php the_permalink(); ?>”><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.

© PHPress since 2008