Home Forums MT Blog Last Updated Instead of Published date

Tagged: 

MT Blog

Forum Index MT Blog Question
  • #3888
  • |
  • 2 years, 9 months ago

Last Updated Instead of Published date

[email protected]
Participant

I wanted to know how can I add last published date rather than the published date in mt blog theme. Without waiting for the next update if there is something I can do myself that would surely help me.

  • #3961
  • |
  • 2 years, 9 months ago
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

  • #6039
  • |
  • 2 years, 2 months ago
Akash
Keymaster

I hope your issue is resolved.

Closing the issue due to no activity.

You can always open a new issue if something else comes up!

  • img-3

    Take Elementor to the Next Level
    Get Mighty Addons today!

    Explore More

  • Viewing 3 posts - 1 through 3 (of 3 total)
    • The topic ‘Last Updated Instead of Published date’ is closed to new replies.
    img-bottom-cta

    Get Products Updates & Promos Directly in your inbox!