Add the Last Updated date in the single post page
1- Add this code to your child theme’s functions.php
file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Avoid adding custom code directly to your parent theme’s functions.php
file, as this will be wiped entirely when you update the theme.
add_filter( 'TieLabs/post_date', 'tie_custom_code_post_date', 20 ); function tie_custom_code_post_date( $date ){ if( is_single() ){ return $date . '<span class="last-updated"> - '. esc_html__( 'Last Updated:', TIELABS_TEXTDOMAIN ) .' '. get_the_modified_date() .'</span>'; } return $date; }
2- Add the following custom CSS code section in Theme Options > Styling > Custom CSS > Custom CSS:
.last-updated { display: none !important; } #the-post .last-updated { display: inline !important; }