public
Last active

Add timestamps to post dates.

  • Download Gist
posted_at.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
<?php
/*
Plugin Name: Posted At
Plugin URI: http://tarskitheme.com/
Description: Add timestamps to post dates.
Author: Benedict Eastaugh
Version: 1.0
Author URI: http://extralogical.net/
*/
function add_times_to_post_dates($date, $d, $post) {
if ($post->ID > 0)
$date = sprintf(__('%s at %s', 'tarski'),
$date,
get_post_time(get_option('time_format'), false, $post));
return $date;
}
 
add_filter('get_the_time', 'add_times_to_post_dates', 10, 3);
?>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.