Snippets: Alter the Blog Post Published Date to Last Modified Date

function myprefix_entry_single_meta_sections( $sections ) {
    if ( is_array( $sections ) && isset( $sections['date'] ) ) {
        $sections['date'] = function() {
            $icon = '<span class="ticon ticon-clock-o" aria-hidden="true"></span>';
            echo  $icon . 'Updated on ' . esc_html( get_the_modified_date( get_option( 'date_format' ) ) );
        };
        return $sections;
    }
}
add_filter( 'wpex_blog_entry_meta_sections', 'myprefix_entry_single_meta_sections' );
add_filter( 'wpex_blog_single_meta_sections', 'myprefix_entry_single_meta_sections' );

Snippet Type: PHP

Posted Under: Blog

All PHP snippets should be added via a child theme's functions.php file or via the Code Snippets Plugin (or alternative plugin)