get_the_date

Sponsored Link

get_the_dateテンプレートタグは、現在の$postが書かれた日付を取得します。
the_date()のこのタグとは異なり、常に日付が返されます。’get_the_date’のフィルターと共に変更出力します。

Sponsored Link

The get_the_date template tag retrieves the date the current $post was written. Unlike the_date() this tag will always return the date. Modify output with ‘get_the_date’ filter.

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

<?php get_the_date( $d ); ?>

get_the_dateのパラメーター

$d

(string) (optional) PHPの日付フォーマットです。

(string) (optional) PHP date format.

デフォルト:date_formatオプションです(設定>一般パネルの’日付フォーマット’です)。

Default: the date_format option (‘Date Format’ on Settings > General panel)

戻り値

(string|null) 表示する場合はNull、取得する場合は文字列です。

(string|null) Null if displaying, string if retrieving.

フィルター

  • apply_filters(‘get_the_date’, $the_date, $d)

変更ログ

  • 3.0.0 : New template tag.

デフォルトの使い方

<span class="entry-date"><?php echo get_the_date(); ?></span>

参照:wp-content/themes/twentyten/single.php

See: wp-content/themes/twentyten/single.php

ソースファイル

get_the_date()は、wp-includes/general-template.php内に位置しています。

get_the_date() is located in wp-includes/general-template.php.

このページは、不完全としてマークされます。あなたはそれを拡大しコデックスを助けることができます。

This page is marked as incomplete. You can help Codex by expanding it.

関連テンプレートタグ

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