Home Forums MT Blog Last Updated Instead of Published date Reply To: Last Updated Instead of Published date

Akash
Keymaster

Hi Kushal,

Thank you for using MT Blog.
Here’s is the concise way of doing it.

=> On Blog post

Replace the code on line number 95 with the code below:


<?php
	$u_time = get_the_time('U');
	$u_modified_time = get_the_modified_time('U');
	if ($u_modified_time >= $u_time + 86400) {
		the_modified_time('F jS, Y'); ?>
	} else {
		echo get_the_time('F jS, Y'); ?>
	}
?>

=> And on Archive Page

Replace the code on line number 83 with the code below:


<?php
	$u_time = get_the_time('U');
	$u_modified_time = get_the_modified_time('U');
	if ($u_modified_time >= $u_time + 86400) {
?>
	<small><?php the_modified_time('F jS, Y'); ?></small>
<?php
	} else {
?>
	<small><?php echo get_the_time('F jS, Y'); ?></small>
<?php
	}
?>

It’ll do the trick.

Thanks,
Akash

img-bottom-cta

Get Products Updates & Promos Directly in your inbox!