Archived topic
Entry Meta Issue with Publish Date and Last Updated Date
3 replies · Started by Samuel on October 4, 2021
Hi Guys,
I used this snippet below to show the updated date for my posts and hid the publish date and it works as expected on my old posts.
.posted-on .updated {
display: inline;
}
.posted-on .published {
display: none;
}
.posted-on .updated:before {
content: "Last Updated ";
}
However, I just published a new article on my website and no date appears on the entry meta, only the author. I expected that the publish date would show as the last updated date or at least the publish date should show as Published On... since it's new and then Last Updated replaces it whenever it is updated. Shouldn't this be the behavior?
How can I fix this, please?
Thanks.
Hi there,
This CSS prevents the date from showing up.
.posted-on .published {
display: none;
}
This CSS applies to ALL posts meaning current existing posts and future posts to be published.
The expected behavior you want to achieve requires PHP snippet rather than CSS. CSS can't be programmed, unfortunately. :D
As for PHP snippets, you can check the one I've provided here - https://generatepress.com/forums/topic/customising-entry-meta-published-vs-updated/#post-1742685
That did the trick man!
Many thanks for your support.
No problem. Glad to be of any help. :D