特定のタグを持つ記事(またはページ)をリスト表示したい
下記のような感じ。(「tagname」のところはタグの名前を入れる)
<ul>
<?php
query_posts('tag="tagname"');
if(have_posts()) :
while(have_posts()) :
the_post();
echo '<li><a href="' . get_permalink() . '">' . get_the_title() . '</a></li>';
endwhile;
endif;
wp_reset_query();
?>
</ul>
固定ページにもタグを使用したい場合は、SimpleTagsを使うのが良さそうです。
関連記事
5月 10, 2011 | No Comments
Comments
Leave a Reply



