Created
April 13, 2022 14:37
-
-
Save smtechno/dbd73745b4d66dd338f2e939365ef042 to your computer and use it in GitHub Desktop.
Last Date Untuk Astra Theme
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
/*-----last update date code for Astra Theme only-----*/ | |
function your_prefix_post_date( $output ) { | |
if ( 'post' === get_post_type() ) { | |
$the_time = get_post_time( 'His' ); | |
$the_modified = get_post_modified_time( 'His' ); | |
$last_modified = sprintf( __( 'Last updated %s', 'astra' ), esc_html( get_post_modified_time( 'M j, Y' ) ) ); | |
$published = sprintf( __( 'Published on %s', 'astra' ), esc_html( get_post_time( 'M j, Y' ) ) ); | |
$date = $the_modified !== $the_time ? $last_modified . ' | ' . $published : $published; | |
return $date; | |
} | |
} | |
add_filter( 'astra_post_date', 'your_prefix_post_date' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment