Created
April 25, 2018 04:04
-
-
Save Steeru/afe72113e4ff0a6f8fdf6118f74c8cca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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