single_month_title – WordPress*リファレンス

現在のページのために月と年タイトルを示すか、返します。mまたはアーカイブの月議論が現在のページ(毎月のアーカイブのページを見るとき、これは起こります)にWordPressによってされたとき、このタグは動くだけです。注:カテゴリーテンプレートまたは他の上ででない、このタグは、日付アーカイブページの上で動くだけです。

原文(翻訳元): ⇒Displays or returns the month and year title for the current page. This tag only works when the m or archive month argument has been passed by WordPress to the current page (this occurs when viewing a monthly archive page). Note: This tag only works on date archive pages, not on category templates or others.

single_month_titleのテンプレートタグ使用方法

<?php single_month_title('prefix', display) ?>

発生しているタイトルは以下の通りになるでしょう。

原文(翻訳元): ⇒The generated title will be:

prefix + MONTH + prefix + YEAR

接頭語パラメタが’*'であるなら、例は以下の通りでしょう。

原文(翻訳元): ⇒If prefix parameter is ‘*’, an example would be:

*February*2004

Month and Year on New Lines

復帰改行の上のタイトル、置く月、および年を表示します。

原文(翻訳元): ⇒Displays the title, placing month and year on new lines.

<p><?php single_month_title('<br />') ?></p>

December 2004

Using $my_month Variable

タイトルを返します。($my_monthの変数はそれに割り当てられます)。 そして、PHPエコーコマンドと共に変数の値を表示します。

原文(翻訳元): ⇒Returns the title, which is assigned to the $my_month variable. The variable’s value is then displayed with the PHP echo command.

<?php $my_month = single_month_title(<i>, false); echo $my_month; ?>

single_month_titleのパラメーター

prefix

原文(翻訳元): ⇒(string) Text to place before the title. There is no default.

display

原文(翻訳元): ⇒(boolean) Display the title (TRUE), or return the title to be used in PHP (FALSE). Defaults to TRUE.

関連テンプレートタグ

the_date_xml, the_date, the_time, the_modified_date, the_modified_time, get_the_time, single_month_title, get_calendar, the_weekday , the_weekday_date