Skip to content

Blog Posts should display the date published rather than the last modified date. #93

Closed

Description

@ErikSolveson

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:

  1. https://opensource.org/blog/a-public-forum-to-discuss-the-open-source-ai-definition
  2. The date on this post should be Jan 26th. Currently it reads april 11th.
Screenshot 2024-06-14 at 1 23 44 PM

Places where the date shows.

[Zendesk]

Activity

  1. geoffguillain commented on Jun 15, 2024

    @geoffguillain

    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:

    1. single blog post: https://opensource.org/blog/a-public-forum-to-discuss-the-open-source-ai-definition
    2. archive page for posts: https://opensource.org/blog/page/4

    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?

  2. ErikSolveson commented on Jun 17, 2024

    @ErikSolveson
    Author

    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!

  3. geoffguillain commented on Jun 18, 2024

    @geoffguillain

    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.

  4. moyvincent commented on Jun 18, 2024

    @moyvincent

    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.

  5. geoffguillain commented on Jun 19, 2024

    @geoffguillain

    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.:
    image

    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>';
    			}
    		}
    
  6. moyvincent commented on Jun 19, 2024

    @moyvincent

    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.

  7. smaffulli commented on Jun 19, 2024

    @smaffulli
    Contributor

    Press mentions should not display last modified.

  8. geoffguillain commented on Jun 21, 2024

    @geoffguillain

    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.

  9. moyvincent commented on Jun 24, 2024

    @moyvincent

    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.

  10. moyvincent commented on Jun 24, 2024

    @moyvincent

    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.

  11. geoffguillain commented on Jun 27, 2024

    @geoffguillain

    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.

  12. moyvincent commented on Jun 27, 2024

    @moyvincent

    Thank you @geoffguillain!

    We can move this to production.

  13. geoffguillain commented on Jun 28, 2024

    @geoffguillain

    The fix has been pushed to production:
    https://opensource.org/meeting-minutes/2024-05-17

  14. moyvincent commented on Jun 28, 2024

    @moyvincent

    I have informed the partner about this update and will update here if there is any feedback.

    Thanks a lot, @geoffguillain!

  15. moyvincent commented on Jun 28, 2024

    @moyvincent

    Partner confirmed all looks good.
    We are goof to close this out!

    Thank you @geoffguillain!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions