I’ve been trying to get a “Last updated: (date)” attached to the frontpage items, based on whether the creation time and last-modified time are equal or not.
I am a total newbie when it comes to coding php, but here’s what i tried:
<?php if (the_time('F j, Y') != the_modified_time('F j, Y')) : ?><i>updated <?php echo the_modified_time('F j, Y'); ?></i> <?php else : ?> test <?php endif ?>
Ofcourse, this isn’t working. I also tried
<?php if (the_date != the_modified_date) : ?><i>updated <?php echo the_modified_time('F j, Y'); ?></i> <?php else : ?>poop <?php endif ?>
The thing is, I would like to have it show when a post has updated content, but [i]not[/i] when the timestamp is equal to the modified stamp.
Do you have any suggestions?
- The topic ‘code-newbie needs help with “last updated”’ is closed to new replies.