Facebookが最近「過去のこの日」というのを始めた。そういえば、昔は私も日記に「一年前の記事」というのを付けていたもんじゃ。
そこで、Wordpressに「過去のこの日の記事リスト」を付けようといろいろ調べて書いてみたのだけれど、どうもうまくいかない。参考にした記事はgetdate()を使って今日の日付を参照していたのでそれをそのままget_the_date()に書き換えてみたり、the_date()に書き換えてみたりしたのだけれど、そんな単純でもないらしい。
<h3>過去の<!--?php $postdate = get_the_date("n月j日"
); query_posts( 'monthnum=' . $postdate["mon"] . '&day=' . $postdate["mday"] . '&orderby=date&order=DESC' ); ?--></h3>
<!--?php while (have_posts()) : the_post(); ?-->
<b><!--?php the_time("Y年n月j日"); ?--></b> <!--?php the_title(); ?-->
<!--?php endwhile;?-->
<!--?php wp_reset_query();?-->
むむむ。誰か教えて下さい。