HOME  »  , ,  » monthchunksの表記を日本語にしてみた

monthchunksの表記を日本語にしてみた

2008/05/06 | Comments & Trackbacks : 2

20080429_capture

このサイトでは月別アーカイブへのリンク表示にmonthchunksを使っているのですが、そのまま使うと全て数字のみで表示されるので、これを「年」とか「月」もくっつくように書き換えました。
上のキャプチャみたいな感じです。
サイドバーで使う分には必要ないと思いますが、未来に備えて一応メモ。

書き換えるのは本体・monthchunks.phpの「// start the list item displaying the year」以降です。

【123行目】

print "<li><strong>$year</strong><br />\n";$year_= $year ."年";
print "<li><strong>$year_</strong><br />\n";

【135行目】

print "<strong title='$month->post_month_name $year'>$month->display_month</strong>";//print "<strong title='$month->post_month_name $year'>$month->display_month</strong>";
$month_ = $month->display_month . "月&nbsp;&nbsp;";
print "<strong title='$month->post_month_name $year'>$month_</strong>";

【139行目】

print "<a href='" . get_month_link($year, $month->post_month) . "' title='$month->post_month_name $year'>" . $month->display_month . "</a>";//print "<a href='" . get_month_link($year, $month->post_month) . "' title='$month->post_month_name $year'>" . $month->display_month . "</a>";
$month_ = $month->display_month . "月&nbsp;&nbsp;";
print "<a href='" . get_month_link($year, $month->post_month) . "' title='$month->post_month_name $year'>" . $month_ . "</a>";

Google Adsense

Comments & Trackbacks : 2

pingback このサイトでも使用しているおすすめWordPressプラグインをまとめてみた。 | ごみおきば2009 年 11 月 2 日 2時00分

[...] た↓のエントリを参照して日本語表記に変更&”& & ”の部分を”& ”にしてレイアウト調整。 monthchunksの表記を日本語にしてみた : 今日の覚え書き Tickler’s bunkum days [...]

pingback WordPressに導入すべき10(+1)のプラグインと入れておくと便利な21のプラグイン。 | ごみおきば2010 年 5 月 1 日 23時40分

[...] エントリを参照して日本語表記に変更。また”&nbsp;&nbsp;”の部分を”&nbsp;”にしてレイアウト調整しました。 monthchunksの表記を日本語にしてみた : 今日の覚え書き Tickler’s bunkum days [...]