Um das Aktualisierungsdatum von Beiträgen auszugeben wird folgender Code in der Datei block-post-modification-date.php
im Verzeichnis blocks
benötigt:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
<?php // No direct access, please if ( ! defined( ‚ABSPATH‘ ) ) { exit; } // Post modification date $article_made = get_the_date(‚U‘); $article_updated = get_post_modified_time(‚U‘); // Show only if update occurred after more than 24 hours if (($article_updated – $article_made) >86400) { $mod_date = get_the_modified_date(‚j. F Y‘); $mod_date_output = ‚Aktualisiert am ‚ . $mod_date; } else { $mod_date_output = “; } echo $mod_date_output; ?> |
Das Ergebnis kann zum Beispiel so aussehen:

Hinweis: Das Plugin Genesis Custom Blocks muss installiert und aktiviert sein.