I want to display post updated time only if post is modified, I am using function the_modified_time()
. So I just read about that there is if statement that can be used to check if post is even modified that looks like this:
if (get_the_modified_time() != get_the_time())
So I put this in my template where the time itself is being displayed so it looks like this now:
if (get_the_modified_time() != get_the_time()){
echo 'Last updated:' . the_modified_time();
}
And it is not showing at all. So obviously I am missing something here.