Archived topic
Updated On not showing after adding the code in additional CSS
9 replies · Started by Bijaya on March 20, 2022
When I am adding the code its removing the Published Date and not generating the Updated on for the article.
https://screenrec.com/share/8d1szKlSiy
Please check.
This code is working on my other site with same theme. What is the issue
Hi there,
Any chance you can link us to the page in question?
You can use the private information field:
https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information
Let me know :)
I am facing the problem in 2 sites, but I am sending you one in which I have implemented one.
Can you try using the block element post meta method?
https://docs.generatepress.com/article/block-element-post-meta-template/
The dynamic data should be what you are looking for:
https://docs.generatepress.com/article/dynamic-data/#post-date
This is the best method now as there would be no CSS required.
No, I don't want this method.
I want an Additional CSS code.
Hi there.
CSS cannot generate HTML - its doing exactly what it is supposed to do. Problem is your posts are not generating an updated date.
Do you have any other codes ( NOT CSS ) relating to the Post Meta ?
When I am adding the below code in my other site,, its showing the Updated date.
Also I am using the same theme and design.
.single .posted-on .updated {
display: block;
}
.single .posted-on .published {
display: none;
}
.single .posted-on .updated:before {
content: "Updated: ";
}
On the site that is working you have the correct HTML for it:
https://www.screencast.com/t/kazRsmhDjgnG
You see there are <time> elements for updated and published.
On your other site there is only the published.
This happens for one of two reasons:
1. You have not updated the post and therefore there is no updated date.
2. Some other code is affecting it.
Can you try updating one of your posts ?
Thanks for the fast promp,
Yes, after updating the content now the updated date is showing.
Now use the CSS provided in this doc:
https://docs.generatepress.com/article/show-the-updated-post-date/
it will make sure that IF there is no Updated date it will display the published date