Last active
March 11, 2023 10:07
-
-
Save gmmedia/bc6ea0cc4923ba68a56697f6ea88a4a0 to your computer and use it in GitHub Desktop.
Astra Theme: Display last modified and publisheddate in the post metadata.
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
<?php | |
/** | |
* Astra Theme: Display last modified and published date in the post metadata. | |
* See: https://j0e.org/astra-tipps-tricks/ | |
*/ | |
function j0e_post_date( $output ) { | |
$output = ''; | |
$format = apply_filters( 'astra_post_date_format', '' ); | |
$published_date = esc_html( get_the_date( $format ) ); | |
$published_on = sprintf( | |
esc_html( '%s' ), | |
$published_date | |
); | |
$modified_date = esc_html( get_the_modified_date( $format ) ); | |
$modified_on = sprintf( | |
esc_html( '%s' ), | |
$modified_date | |
); | |
$output .= ''; | |
$output .= 'Aktualisiert: ' . $modified_on . ' | Erstausgabe: ' . $published_on; | |
$output .= ''; | |
return $output; | |
} | |
add_filter( 'astra_post_date', 'j0e_post_date' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment