Languages: English • 日本語 (Add your language)
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.
Use get_the_modified_date() to retrieve the value.
<?php the_modified_date( $d, $before, $after, $echo ); ?>
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>
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>
Displays the date and time.
<p>Modified: <?php the_modified_date('F j, Y'); ?> at <?php the_modified_date('g:i a'); ?></p>
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 <sup> and subscript is <sub>.
<p>Modified: <?php the_modified_date('j\<\s\u\p\>S\<\/\s\u\p\> M Y'); ?></p>
the_modified_date() is located in wp-includes/general-template.php
.
get_calendar(), get_day_link(), get_month_link(), get_the_date(), get_the_time(), get_year_link(), single_month_title(), the_date(), the_date_xml(), the_modified_date(), get_the_modified_date(), the_modified_time(), get_the_modified_time(), the_time()