Site logo

Archived topic

How to display published date and updated post date next to each other?

7 replies · Started by Jude on July 11, 2021

Viewing posts 1–8 of 8

Hi there, I was wondering if you can help me out with the CCS code to change the post date structure of my posts?

Now it displays the date is published and my name, and if I update the post, it is not visible for my audience.

I wondered if it is possible to get 1. (published + date), 2( last updated +date) 3. by Author (By Jude)

I hope this makes sense,

Looking forwards to hearing from you,
Jude

Hi Jude,

Try this CSS:

.posted-on .updated {
    display: inline-block;
    padding-right: 5px;
}
.posted-on .published:before {
    content: "Published ";
}
.posted-on {
    display: inline-flex;
}
.posted-on .published {
    order: -1;
    padding-right: 5px;
}

Hi Ying, thanks for your reply.

I tried the code, and it is almost good but missing the word 'last updated' before the second date.
Is it possible to include this as well?

Thank you so much for your help.
Jude

Hi Jude,

I tried the code, and it is almost good but missing the word ‘last updated’ before the second date.
Is it possible to include this as well?

Try adding this CSS:

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

this should add Last Updated before the second date.

Thank you, Elvin, this worked. I appreciate your help.

Have a great day.
Jude

No problem. Stay safe! :D

I had the same question and it works fine for desktop view. One mobile phone view the date is now shown like this:

18 July last updated on 21 July
2021 2021

Is it possible to add a css code to show post date in first line and then last updated in one line below only on mobile view?

Hi Daniel,

You can try this:

.posted-on > * {
    display:block;
}
This archived topic is closed to new replies.