Greetings,
I found your answer actually already in the WordPress Codex. Here is the conditional:
if (get_the_modified_time() != get_the_time()) {
// show modified time
the_modified_time();
}
I found this under “Description” on the following page:
http://codex.wordpress.org/Function_Reference/the_modified_time
Good luck,
Paul
Thread Starter
kalsey
(@kalsey)
Nice work Paul its work me like a Charm. I used like this in the Single.php
<?php if (get_the_modified_time() != get_the_time()) {
// show modified time
the_modified_time();
} ?>
and its working great, but one more you can do. I need to add this “Modified:” in this condition, because If I place it before the <?php
it also shown on that post also that don’t had the Modified time. I think understand my query.
Exmaple
Your Condition shows
Published: July 22, 2013 , 6:55 pm | 7:03 pm
But I need
Published: July 22, 2013 , 6:55 pm | Modified: 7:03 pm
IF I put the “Modified:” before php I get this on that post which don’t had the modified time
Published: July 22, 2013 , 6:52 pm | Modified:
Sure, just add the “Modified” inside the conditional:
<p>Modified: <?php the_modified_time(); ?></p>
Glad this helps out.
Take care,
Paul
Thread Starter
kalsey
(@kalsey)
Where to put in this condition
<?php if (get_the_modified_time() != get_the_time()) {
// show modified time
the_modified_time();
} ?>
<?php
if (get_the_modified_time() != get_the_time()) {
// show modified time
?>
<p>Modified: <?php the_modified_time(); ?></p>
<?php
}
?>
The above is one way to do it.
Paul
Thread Starter
kalsey
(@kalsey)
Nice coding Paul work like a charm
THANKS A LOT