Home › Forums › Support › Show updated/published date with WP Shows Posts (Post lists) and on normal posts
- This topic has 9 replies, 3 voices, and was last updated 3 years, 2 months ago by Elvin.
-
AuthorPosts
-
January 25, 2021 at 11:35 pm #1633710amarinos
Hi @Tom and support team,
we want to show the updated/published date on wpsp posts lists and on all posts pages. We achieved to show the dates on a posts lists page (see screenshot: https://drop.tdv.cloud/WXQCHb) with this css code:
.wp-show-posts-updated { display: block; } .wp-show-posts-updated:before { content: "Updated on "; } .wp-show-posts-entry-date:before { content: "Published on "; }
But on the posts page itself (see screenshot: https://drop.tdv.cloud/jUhF2h) updated/published dates are not shown. We need your help here π … What code snippet or CSS is needed?
January 26, 2021 at 12:07 am #1633735ElvinStaffCustomer SupportHi there,
You can show the updated date on a similar manner with the CSS provided on this documentation.
https://docs.generatepress.com/article/show-the-updated-post-date/We simply changed the selectors. π
January 26, 2021 at 12:19 am #1633751amarinosHi @Elvin,
thanks for helping us. I added the css from your link:
.posted-on .updated { display: inline-block; } .posted-on .updated + .entry-date { display: none; } .posted-on .updated:before { content: "Last Updated "; }
Now I see on the posts page this: https://drop.tdv.cloud/rHQFzB
Great, but in here we want also the “Published on” date … What must be done now?January 26, 2021 at 12:49 am #1633776ElvinStaffCustomer SupportAdd this CSS:
.posted-on .published:before { content: "Published on "; }
January 26, 2021 at 1:32 am #1633820amarinosI added the additional CSS – nothing changed. Only “Last updated: …” is shown …
For our overview, here the complete CSS I added:
.wp-show-posts-updated { display: block; } .wp-show-posts-updated:before { content: "Updated on "; } .wp-show-posts-entry-date:before { content: "Published on "; } .posted-on .updated { display: inline-block; } .posted-on .updated + .entry-date { display: none; } .posted-on .updated:before { content: "Last Updated "; } .posted-on .published:before { content: "Published on "; }
January 26, 2021 at 9:58 am #1634575TomLead DeveloperLead DeveloperHi there,
Any chance you can link us to the page?
January 26, 2021 at 10:52 am #1634656amarinosHi @Tom,
sure … Have a look in the private information field π …
January 26, 2021 at 5:38 pm #1634957ElvinStaffCustomer SupportThank you for providing the information.
You have this custom CSS that prevents the published date from displaying:
.posted-on .updated + .entry-date { display: none; }
I believe you can remove this if you want both the dates to show.
Optional: You can add this in if you want the dates to display in one line.
.posted-on time.entry-date.published { display: inline-block; margin: 0 10px; }
January 28, 2021 at 9:03 am #1637258amarinosHello @Elvin,
worked! I have to learn a bit of CSS π …
I added the optional CSS to display the dates in one line … Worked!
But if only a “Published date” exists and no “updated date” it looks like this: https://drop.tdv.cloud/j6Uytf … Is it possible to get the “Published date” aligned with the body text to the left?
January 28, 2021 at 3:45 pm #1637600ElvinStaffCustomer SupportLet’s change this:
.posted-on time.entry-date.published { display: inline-block; margin: 0 10px; }
To this:
.posted-on time.entry-date.published { display: inline-block; }
And then add this:
span.posted-on > *:first-child { margin-right: 10px; }
-
AuthorPosts
- You must be logged in to reply to this topic.