25% off ProSNIPC25OFF

Show Modified Instead of Published Date

Replaces the displayed post date with the last-modified date on single posts.

PHPby SnipCraft
php
<?php
add_filter( 'get_the_date', 'scseed_replace_date_with_modified', 10, 3 );
if ( ! function_exists( 'scseed_replace_date_with_modified' ) ) {
    function scseed_replace_date_with_modified( $the_date, $format, $post ) {
        if ( ! is_singular( 'post' ) ) {
            return $the_date;
        }
        $fmt = $format ? $format : get_option( 'date_format' );
        return get_post_modified_time( $fmt, false, $post, true );
    }
}
#content#dates#display#posts#seo