Skip to content

Instantly share code, notes, and snippets.

<?php
$last_modified = human_time_diff( the_modified_date('U','','', false), current_time('timestamp') );
$number_of_x = preg_replace('/[^0-9]*/', '', $last_modified);
if ( strpos( $last_modified, 'min' ) || strpos( $last_modified, 'hour' ) || strpos($last_modified, 'sec' ) ) {
$wiki_date = $last_modified;
} elseif ( $number_of_x > 365 ) {
$wiki_date = __( 'a long time' );
} elseif ( $number_of_x >= 180 ) {
$wiki_date = __( 'less than a year' );
} elseif ( $number_of_x >= 60 ) {