Closed ErikSolveson closed 2 months ago
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?
Hi @geoffguillain -
Press mentions are also using the updated dates. Do you want to display the created date for those too?
No lets keep Press as last modified, they clarified that specifically Posts should be Published date and the others should remain unchanged.
Thanks!
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.
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".
Special care should be taken to ensure this doesn't affect other content types (Pages, licenses, meeting minutes, etc.)
Can you please confirm if the fix must have affected the Pages, licenses, meeting minutes, etc?
Thank you.
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. 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>';
}
}
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.
Press mentions
should not display last modified.
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.
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.
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.
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.
Thank you @geoffguillain!
We can move this to production.
The fix has been pushed to production: https://opensource.org/meeting-minutes/2024-05-17
I have informed the partner about this update and will update here if there is any feedback.
Thanks a lot, @geoffguillain!
Partner confirmed all looks good. We are goof to close this out!
Thank you @geoffguillain!
Description
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.)
https://opensource.org/blog/a-public-forum-to-discuss-the-open-source-ai-definition
Steps to reproduce
One Example:
Places where the date shows.
[Zendesk]