Site logo

Archived topic

Posted date and Updated date

9 replies · Started by Evgeniya on August 12, 2018

Viewing posts 1–10 of 10

Hi, everyone.
I have searched whole support forum and have found all kind of answers on that topic. Just not the answer i was looking for. Is there a function that can make the updated date appear isntead of published date but only if the post was really updated? And in the posts that were not apdated appeared only published date? Currently i have the code that shows Last updated date. Although i did not really updated post. I just published it.

Hello, Leo.
Sorry for the long time answering. I have just tried mentioned code. And it did not work well. For the single post i didn't updated the published date doesn't appear at all. But for the single post i did update it works great.
But maybe it has something to do with CSS i used:
.posted-on .updated {
display: inline-block;
}

.posted-on .updated:before {
content: "Последние изменения: ";
}

I used that PHP code. And i have just removed CSS i mentioned earlier. Now posts do not display date at all. Not in updated posts. Not in the posts that were not updated.

Try this CSS:

.posted-on .updated {
    display: inline-block;
}

However, the same issue might happen. The updated date should only appear if it's different than the posted date. This includes the time. Are you saying the updated date is showing even if you just publish the post?

Now that i have added CSS

.posted-on .updated {
display: inline-block;
}

everything is fine. But i have one more question. How can i make posts on main page to sort by updated date?

Can you open a new topic for this separate question?

It might be useful for others as well and will be easier for us and others to search.

Thanks!

Hello, everyone.
Regarding my question abaut displaying updated date. To my previous CSS

.posted-on .updated {
display: inline-block;
}

I have added CSS

.posted-on .updated:before {
content: “Last updated: “;
}

And now the phrase "Last updated" shows not only in updated posts.It also shows in just published posts too. How can i make it appear only in updated posts?

Hi there,

try this CSS for before pseudo element:

.posted-on .updated:not(:empty):before {
    content: “Last updated: “;
}
This archived topic is closed to new replies.