дядя, сколько времени?

10:21 | 16-09-2008 | HOWTO, Software | No Comments

если кому-нибудь нужно в WordPress-странице указать дату ее последней модификации, то вот замечательное руководство:

If you want to insert a ‘last updated’ or ‘last modified’ date on your wordpress page, then there is a simple bit of PHP code you can use for this:

<?php the_modified_time('F jS, Y');?>

And via Ardamis’s Blog, there is a great way to only display this information if it has been modified after the original post date. This is a good way to let people know if there have been updates since the original post:

<?php $u_time = get_the_time('U');
$u_modified_time = get_the_modified_time('U');
if ($u_modified_time >= $u_time + 86400) {
echo "and last modified on ";
the_modified_time('F jS, Y');
echo " at ";
the_modified_time();
echo ", "; } ?>

This will display the last modified date and time if it is more than 86400 seconds after the creation date – that is 24 hours.

  

Leave a Reply