You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Blog Posts should display the date published rather than the last modified date. #93
For all posts we would like the date to be the Publish date of the post rather than the Last modified date (as it currently is). Special care should be taken to ensure this doesn't affect other content types (Pages, licences, meeting minutes, etc.)
I had a look at your test but I can't see any dates displayed. Could you be more precise about what you are seeing?
If you talk about the listing pages in the admin, they are displaying the published date since this is the default behavior on those admin pages for published posts. Draft on their side shows the Last modified date. I have not touched this core behavior in any way.
eg.:
The generated HTML that displays dates on posts looks like this: <time class="byline--date entry-date published" datetime="YYYYMMDD">_THE DATE_</time>
I can't see this HTML on the page's code source you are mentioning.
Can you please confirm if the fix must have affected the Pages, licenses, meeting minutes, etc?
The condition I have added specifically excludes the post type post meaning only blog posts can be excluded. I can confirm that any other post types (Pages, licenses, meeting minutes) using this template part won't be affected.
$time_string = '<time class="byline--date entry-date published" datetime="%1$s">%2$s</time>';
// Don't display the updated date for blog posts.
if ( 'post' !== get_post_type() ) {
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$time_string .= '<time class="byline--date entry-date published updated" datetime="%3$s">%4$s</time>';
}
}
My understanding of the issue was that these post types (Pages, licenses, meeting minutes), would show "last-modified" on the "Date" column once updated in the WP-admin but I was wrong 😞.
Thank you for clarifying this.
This looks good and we can move this to Production.
Activity
geoffguillain commentedon Jun 15, 2024
Hey @ErikSolveson,
I have a fix for this but I don't have commit rights on this repo yet, I will ask to be added to create a pull request.
Here are the templates that will be updated:
Dates on the post feed are looking good to me: https://opensource.org/feed
Press mentions are also using the updated dates. Do you want to display the created date for those too?
ErikSolveson commentedon Jun 17, 2024
Hi @geoffguillain -
No lets keep Press as last modified, they clarified that specifically Posts should be Published date and the others should remain unchanged.
Thanks!
geoffguillain commentedon Jun 18, 2024
Hey @ErikSolveson
I have updated the blog post single and archive pages to display the published date instead of the updated date.
eg. https://open-source-initiative-development.mystagingwebsite.com/blog/open-source-ai-definition-weekly-update-mar-11
Please take a look and let me know if you have any questions.
moyvincent commentedon Jun 18, 2024
Hi @geoffguillain, Thanks for this!
I just checked the Licenses and the Press section to make sure that those still show the "last modified".
I Tested this out by updating a test license and noticed that it shows the "published" which I think should be "last modified".
Can you please confirm if the fix must have affected the Pages, licenses, meeting minutes, etc?
Thank you.
geoffguillain commentedon Jun 19, 2024
Hey @moyvincent,
I had a look at your test but I can't see any dates displayed. Could you be more precise about what you are seeing?
If you talk about the listing pages in the admin, they are displaying the published date since this is the default behavior on those admin pages for published posts.

Drafton their side shows the Last modified date. I have not touched this core behavior in any way.eg.:
The generated HTML that displays dates on posts looks like this:
<time class="byline--date entry-date published" datetime="YYYYMMDD">_THE DATE_</time>I can't see this HTML on the page's code source you are mentioning.
The condition I have added specifically excludes the post type
postmeaning only blog posts can be excluded. I can confirm that any other post types (Pages, licenses, meeting minutes) using this template part won't be affected.moyvincent commentedon Jun 19, 2024
Hi @geoffguillain,
Thank you for this!
My understanding of the issue was that these post types (Pages, licenses, meeting minutes), would show "last-modified" on the "Date" column once updated in the WP-admin but I was wrong 😞.
Thank you for clarifying this.
This looks good and we can move this to Production.
smaffulli commentedon Jun 19, 2024
Press mentionsshould not display last modified.geoffguillain commentedon Jun 21, 2024
The fix has been pushed to production.
eg.
https://opensource.org/blog/a-public-forum-to-discuss-the-open-source-ai-definition
Other post types are still using the last modified output:
https://opensource.org/osd
Please take a look and let me know if you have any questions.
moyvincent commentedon Jun 24, 2024
Hi @geoffguillain,
Thank you for looking into this.
I will inform the partner of the change in the Zendesk thread and update back here based on the feedback.
moyvincent commentedon Jun 24, 2024
Hi @geoffguillain,
We just got feedback from the partner and they would like to allow the Meeting Minutes to display only the Published date.
Example: https://opensource.org/meeting-minutes/2024-05-17
The example has both the published date and the last modified date.
Thank you.
geoffguillain commentedon Jun 27, 2024
Hey @moyvincent
I have excluded the Meeting minutes for displaying the updated date.
eg. develop: https://open-source-initiative-development.mystagingwebsite.com/blog/meeting-minutes/2024-01-19
Let me know if I can merge this to the production server.
moyvincent commentedon Jun 27, 2024
Thank you @geoffguillain!
We can move this to production.
geoffguillain commentedon Jun 28, 2024
The fix has been pushed to production:
https://opensource.org/meeting-minutes/2024-05-17
moyvincent commentedon Jun 28, 2024
I have informed the partner about this update and will update here if there is any feedback.
Thanks a lot, @geoffguillain!
moyvincent commentedon Jun 28, 2024
Partner confirmed all looks good.
We are goof to close this out!
Thank you @geoffguillain!