特定のカテゴリの最新5件タイトルを表示する

Posted: 1月 23rd, 2010 | Author: admin | Filed under: template, wordPress | No Comments »

カテゴリーid 5の場合

<h2>最新ニュース</h2>
<ul class="list">
<?php $posts = get_posts(‘numberposts=5&orderby=post_date&category=9′);
foreach($posts as $post):
setup_postdata($post); ?>
<li><a href="<?php the_permalink(); ?>" id="post-<?php the_ID(); ?>"><?php the_title(); ?></a> <?php the_time(‘y年m月d日’); ?></li>
<?php endforeach; ?>
<div class="next"><a href="<?php bloginfo(’siteurl’); ?>/?cat=9"></a></div>
</ul>



Leave a Reply