Skip to content

Instantly share code, notes, and snippets.

@jgalea
Created August 14, 2013 14:30
Show Gist options
  • Save jgalea/6231591 to your computer and use it in GitHub Desktop.
Save jgalea/6231591 to your computer and use it in GitHub Desktop.
Use the last updated date rather than publish date on posts.
<?php
add_filter( 'genesis_post_info', 'custom_post_info' );
function custom_post_info( $post_info ) {
$u_time = get_the_time( 'U' );
$u_modified_time = get_the_modified_time( 'U' );
if ( $u_modified_time >= $u_time + 86400 ) {
$post_date = get_the_modified_time( 'F jS, Y' );
}
else {
$post_date = get_the_time( 'F jS, Y' );
}
$post_info = __( 'By', 'genesis' ) . ' [post_author_posts_link] ' . __( 'on ', 'genesis' ) . $post_date .' [post_comments] [post_edit]';
return $post_info;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment