Archived topic
Change published to update date
10 replies · Started by Deniz Akay on April 17, 2017
Hi,
I want to replace published date with the last updated date on post pages. Normally the code looks like this:
Last updated on <time datetime="<?php the_modified_time('Y-m-d'); ?>"><?php the_modified_time('F jS, Y'); ?></time>
I couldn't find which file I should change. Thanks.
You could try this CSS:
.posted-on .updated {
display: inline-block;
}
.posted-on .published:not(:last-child) {
display: none;
}
I used "posted-on" (not post-on) on both CSS lines and it worked. Thanks.
How can I add the words "Last updated:" before update date?
Just edited my CSS above - can you give it another try?
Thanks, it works. How can I add the words “Last updated:” before update date?
You could try:
.posted-on .updated:before {
content: "Last updated: ";
position: relative;
}
That's great! Many thanks for your support.
You're welcome :)
Hey guys
I added this code (below) to my CSS as I only want to see 'Last updated <DATE> By <AUTHOR>
It works but the original 'published' date still remains also
Any pointers?
This is what I added (but now removed)
.posted-on .updated {
display: inline-block;
}
.posted-on .published:not(:last-child) {
display: none;
}
.posted-on .updated:before {
content: "Last updated: ";
position: relative;
}
Thanks!
don't worry, I figured it after a bit more Googling!
.posted-on .updated {
display: inline-block;
}
.posted-on .updated + .entry-date {
display: none;
}
.posted-on .updated:before {
content: "Last Updated ";
}
Glad to hear that!