Created
October 12, 2020 16:13
-
-
Save shubhw12/9a753c2b60f95898b1e0b9b5ecbf4689 to your computer and use it in GitHub Desktop.
Show both last updated and published date in the post meta.
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 your_prefix_post_date( $output ) { | |
$format = apply_filters( 'astra_post_date_format', '' ); | |
$modified_date = esc_html( get_the_modified_date( $format ) ); | |
$modified_on = sprintf( | |
esc_html( '%s' ), | |
$modified_date | |
); | |
$separator = ' /'; | |
$separator = apply_filters( 'astra_post_meta_separator', $separator ); | |
$published_string = _('Published : ' , astra ); | |
$updated_string = _('' . $separator . ' Updated : ' , astra ); | |
$updated_output .= ''; | |
$updated_output .= ' ' . $modified_on . ''; | |
$updated_output .= ''; | |
$modified_output = $published_string . $output . $updated_string . $updated_output; | |
return $modified_output; | |
} | |
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