Skip to content

Instantly share code, notes, and snippets.

@Steeru
Created April 25, 2018 04:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Steeru/afe72113e4ff0a6f8fdf6118f74c8cca to your computer and use it in GitHub Desktop.
Save Steeru/afe72113e4ff0a6f8fdf6118f74c8cca to your computer and use it in GitHub Desktop.
function tp_philosophy_pro_posted_on() {
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$time_string = '<time class="entry-date published" datetime="%1$s"><a href="%5$s">%2$s</a></time><time class="updated" datetime="%3$s">%4$s</time>';
}
$year = get_the_date( 'Y' );
$month = get_the_date( 'm' );
$day = get_the_date( 'd' );
$time_string = sprintf( $time_string,
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_attr( get_the_modified_date( 'c' ) ),
esc_html( get_the_modified_date() ),
esc_url( get_day_link( $year, $month, $day ) )
);
$byline = esc_html__( 'by:', 'tp-philosophy-pro' ) . get_the_author();
echo $time_string;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment