the_modified_date

Sponsored Link

the_modified_dateのタグは、最終更新された記事の日付(と時間)を表示します。the_modified_dateのタグは、最終更新された記事の時間/日付を表示する、the_modified_time()と同じように動作します。このタグはループ内で使用する必要があります。フォーマットパラメータが指定されていない場合、デフォルトの日付フォーマット(日付フォーマットと言うので注意してください。)は、管理画面>設定>一般から設定されている表示フォーマットを使用します。

Sponsored Link

This tag displays the date (and time) a post was last modified. This tag works just like the_modified_time(), which also displays the time/date a post was last modified. This tag must be used within The Loop. If no format parameter is specified, the Default date format (please note that says Date format) setting from Administration > Settings > General is used for the display format.

記事かページがまだ更新されていない場合、更新日は作成日時と同じです。

If the post or page is not yet modified, the modified date is the same as the creation date.

値を取得するためにget_the_modified_dateを使用します。

Use get_the_modified_date to retrieve the value.

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

<?php the_modified_date( $d, $before, $after, $echo ); ?> 

the_modified_dateのパラメーター

$d

(string) (optional) 表示されている日付フォーマットです。WordPressの設定で構成されている日付フォーマットを表示します。日時のフォーマットを参照してください。

(string) (optional) The format the date is to display in. Defaults to the date format configured in your WordPress settings. See Formatting Date and Time.

デフォルト:日付フォーマットは、管理画面>設定>一般に指定されています。

Default: date format specified in Administration > Settings > General

$before

(string) (optional)日付の前に出力します。

(string) (optional) Output before the date

Default: None

$after

(string) (optional) 日付の後に出力します。

(string) (optional) Output after the date

Default: None

$echo

(string) (optional) 戻り値の出力です。

(string) (optional) Return output

Default: true

デフォルトの使い方

管理画面>設定>一般から設定(例. F j, Y)されているデフォルトの日付フォーマットを使用している、最終更新された記事の日付を表示します。

Displays the date the post was last modified, using the Default date format setting (e.g. F j, Y) from Administration > Settings > General.

<p>Last modified:<?php the_modified_date(); ?></p>
Last modified: December 2, 2006

年月日として日付を表示する方法

‘F j, Y’(例:2006 年12月2日)の日付フォーマットで最終更新日を表示します。

Displays the last modified date in the date format ‘F j, Y’ (ex: December 2, 2006).

<div>Last modified:<?php the_modified_date('F j, Y'); ?></div>
Last modified: December 2, 2006

日付と時間を表示する方法

日付と時間を表示します。

Displays the date and time.

<p>Modified:<?php the_modified_date('F j, Y'); ?> at<?php the_modified_date('g:i a'); ?></p>
Modified: December 2, 2006 at 10:36 pm

上付きまたは下付きの番号の添え字と一緒に日付を表示する方法

日付の後にst, nd, rd, thの上付きまたは下付きと一緒に日付を表示します。
Because characters from the alphabet are used to represent the date format types,
アルファベットの文字が日付フォーマットのタイプを表すために使用されるため、各HTMLタグの文字がバックスラッシュを使用してエスケープする必要があります。上付きのHTMLは で、下付きはです。

Displays the date with a superscript or subscript st, nd, rd or th after the day. Because characters from the alphabet are used to represent the date format types, each of the HTML tag characters need to be escaped using a back slash. Superscript HTML tag is and subscript is.

<p>Modified:<?php the_modified_date('j\<\s\u\p\>S\<\/\s\u\p\> M Y'); ?></p>
Modified: 2nd Dec 2006

変更ログ

Since: 2.1.0

関連テンプレートタグ

the_time, the_date, the_date_xml, the_modified_time, the_modified_date, the_modified_author, single_month_title, get_the_time, get_day_link, get_month_link, get_year_link, get_calendar

Sponsored Link