WordPressのサイドバーで最新投稿記事を表示する覚え書き
サイドバーに最新記事を表示させたい時の覚え書き
<?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>この記事を読んだ方は下記の記事も読んでいます。
コメント・トラックバック
コメントをどうぞ

