2017年7月6日2017年7月6日wpm
WordPress|get_the_modified_date|function コードリファレンス
WordPress の テンプレートタグ「 get_the_modified_date」は現在の投稿記事や固定ページの最終更新日で取得される日付はフォーマットは ダッシュボード > 設定 > 一般 > 日付フォーマットで指定されて文字列で出力されます。「PHP 関数 コード」
PHP 4, PHP 5, PHP 7
テンプレートタグ get_the_modified_date

現在の投稿 記事 が変更されていた日付を表示
| タグ 使用方法 | <?php get_the_modified_date( $d ); ?> |
|---|
| パラメータ ( 引数 ) | $ d |
|---|
| 説明 | 投稿が最後に変更された日付を取得します。 |
|---|
| デフォルトはダッシュボード > 設定 > 一般 > 日付フォーマットで指定されて文字列で出力 |
パラメータ に日付書式を指定しない場合は上記と同じくデフォルトの文字列(値)
関連するテンプレートタグ the_time()もあります。
関連する「 日付や時刻の取得 設定 表示方法 」もあります。
|
実例・使い方
| デフォルトの日付フォーマットで現在の投稿の最終更新日を取得します。 |
|---|
| functionコード | <?php the_modified_date();?> |
|---|
| 表示 | 2017/5/17 |
|---|
| 最終更新日のタイトルを入れる方法 |
|---|
| functionコード | <p>最終更新日:<?php the_modified_date();?> </p> |
|---|
| 表示 | 最終更新日:2017-05-17 |
|---|
| 最後の変更日を年月日形式で表示する方法 |
|---|
| functionコード |
<p>最終更新日:<?php the_modified_date('Y年 F d日');?> </p>
|
|---|
| 表示 | 最終更新日:2017年 5月 17日 |
|---|
| 最後の変更日を日付と時刻で表示する方法 |
|---|
| functionコード | <p>変更日 : <?php the_modified_date('Y年Fd日'); the_modified_date(' Ag:i');?></p> |
|---|
| 表示 | 変更日 : 2017年5月17日 AM11:54 |
|---|
| 変更日にWebフォントで装飾して表示する方法 |
|---|
| functionコード | <p>変更日 : <i class="fa fa-calendar"></i> <?php the_modified_date('Y年Fd日');?> <i class="fa fa-clock-o"></i> <?php the_modified_date(' Ag:i');?></p> |
|---|
| 表示 | 変更日 : 2017年5月17日 AM11:54 |
|---|