Last active
May 29, 2017 23:21
-
-
Save Perun/5861746 to your computer and use it in GitHub Desktop.
Es wird erkannt wenn ein Artikel aktualisiert wurde (1. Datei) und die Aktualisierungszeit wird dann im Frontend ausgegeben (2. Datei). Siehe auch http://www.perun.net/2013/03/19/wordpress-habt-keine-angst-vor-dem-artikel-datum/.
This file contains hidden or 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 | |
| function aktualisierung() | |
| { | |
| $artikel_erstellt = get_the_date('U'); | |
| $artikel_aktualisiert = get_post_modified_time('U'); | |
| // Nur Aktualisierungen die älter als 12h sind werden berücksichtigt | |
| if (($artikel_aktualisiert - $artikel_erstellt ) > 43200) | |
| { | |
| echo ' – Aktualisiert am ' . get_the_modified_date('d.m.Y') . ' um ' . get_post_modified_time('H:i'); | |
| } | |
| } | |
| ?> |
This file contains hidden or 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 echo aktualisierung(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment