Home Forums MT Blog Last Updated Instead of Published date

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  Akash 1 week ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • digitalkushal@gmail.com

    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.

    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

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.