[k]id » WordPressのサイドバーで最新投稿記事を表示する覚え書き 

2008年8月28日

WordPressのサイドバーで最新投稿記事を表示する覚え書き

Yahoo!ブックマークに登録

1 Star2 Stars3 Stars4 Stars5 Stars (現在評価はありません。)
Loading ... Loading ...

サイドバーに最新記事を表示させたい時の覚え書き

<?php get_archives('postbypost', '5', 'custom', '', '<br />'); ?>
<?php get_archives('postbypost','5','custom','<li>',''); ?>
<?php wp_get_archives('type=postbypost&limit=5&format=custom'); ?>
 

これのwp_get_archivesのtypeに
type=postbypostで最新からリストを表示
type=yearlyで年ごとのリストを記事表示。
type=monthlyで月ごとのリストを記事表示。
type=dailyで日ごとのリストを記事表示。
type=weeklyで週ごとのリストを記事表示。
になります。
 

さらに

覚え書き(ドロップダウンメニュー)

<form name="archiveform" action="">
<select name="archive_chrono" onchange="window.location = (document.forms.archiveform.archive_chrono[document.forms.archiveform.archive_chrono.selectedIndex].value);">
<option value=''>Select Month</option>
<?php get_archives('monthly', '', 'option', '', '', TRUE); ?>
</select>
</form>










Comments

Powered by Facebook Comments

この記事を読んだ方は下記も投稿も読んでいます

コメント・トラックバック

トラックバック

コメントする

Filed under: WordPress Tips