the_date()同日を年で管理したい
-
現在、記事一覧をthe_date()で表示してます。
以下の様に表示になって困ってます。
2011年
記事1(2011年4月19日の記事)
記事2(2011年4月19日の記事)
2011年
記事3(2011年3月12日の記事)
2011年
記事4(2011年2月11日の記事)
2010年
記事5(2010年3月01日の記事)
記事6(2010年3月01日の記事)
2010年
記事7(2010年2月01日の記事)
記事8(2010年2月01日の記事)
2009年
記事9(2009年2月01日の記事)
記事10(2009年2月01日の記事)と、この様になってます。
この表示を以下のように年で分けたいのですが、どなたかご助力願います。
2011年
記事1(2011年4月19日の記事)
記事2(2011年4月19日の記事)
記事3(2011年3月12日の記事)
記事4(2011年2月11日の記事)
2010年
記事5(2010年3月01日の記事)
記事6(2010年3月01日の記事)
記事7(2010年2月01日の記事)
記事8(2010年2月01日の記事)
2009年
記事9(2009年2月01日の記事)
記事10(2009年2月01日の記事)ソースは以下使用
<dl>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php the_date(‘Y年’,'<dt>’,'</dt>’); ?>
<dd><?php the_title(); ?></dd>
<?php endwhile; ?><?php else : ?>
現在記事はありません。
<?php endif; ?>
</dl>
- トピック「the_date()同日を年で管理したい」には新たに返信することはできません。