WordPress:Template Tags/the modified date

来自站长百科
Xxf3325讨论 | 贡献2008年6月25日 (三) 11:28的版本 (新页面: == Description == This tag displays the date (and time) a post was last modified. This tag works just like the_modified_time(), which also ...)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航、​ 搜索

Description

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 WordPress: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.

Usage

%%% <?php the_modified_date('d'); ?> %%%

Examples

Default Usage

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

Date as Month Day, Year

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

Date and Time

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

Parameters

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

Related

模板:Tag Date Tags

模板:Tag Footer