[Resolved] How to Show “Last Updated Date” As Well As The Original Published Date?

Home Forums Support [Resolved] How to Show “Last Updated Date” As Well As The Original Published Date?

Home Forums Support How to Show “Last Updated Date” As Well As The Original Published Date?

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #2039669
    Asen

    Hey guys,

    This should be an easy one but not sure how to make it work. I’ve read some similar post threads in vain.
    On single posts, I’d like to show the “date last updated” along with the original published date.
    How can I do this?
    Many thanks in advance for your help!

    Regards,

    Asen

    #2039818
    David
    Staff
    Customer Support

    Hi there,

    is this across the site ? ie. home page ( which is using WPSP ), blog/archives and single posts?

    #2039881
    Asen

    Hi!

    Only on single blog posts.

    Regards,

    Asen

    #2040420
    David
    Staff
    Customer Support

    Simplest method is to create your own Post Meta with a Block Element:

    https://docs.generatepress.com/article/block-element-post-meta-template/

    #2122295
    Asen

    Hey David,

    Thanks for that.
    I saw the documentation, but it’s still not clear for my how to display the last updated date along with the original published data.
    I also saw this document here https://docs.generatepress.com/article/generate_post_date_output/#only-show-updated-date
    that shows this code: add_filter( ‘generate_post_date_show_updated_only’, ‘__return_true’ );
    but this is only for showing the last updated date and hiding the original published date.

    Can you please help further?

    Many thanks!

    #2122359
    Elvin
    Staff
    Customer Support

    Hi Asen,

    That documentation is for the default meta of the theme.

    And yes you’re correct. It’s only for showing the updated date only.

    We can actually do this with CSS if you’re using the default meta. Try this one:

    .posted-on .updated,
    .posted-on .updated + .entry-date {
        display: inline-block;
    }

    Here’s how to add CSS –
    https://docs.generatepress.com/article/adding-css/

    Note: No updated date will display if the post has no history of modification.

    Here’s how David’s suggestion would look like if executed –
    https://share.getcloudapp.com/p9uXmZ7A

    #2123983
    Asen

    Thanks Elvin!
    The CSS code didn’t work well, but I tried the David’s approach and I almost did it.
    It’s just that there’s no space between “Last Updated On” and the actual date, even though there’s such space when I create the element in WordPress.
    Check this out https://paste.pics/6a9ceb15ff6fdd716d0b594275332224 and https://paste.pics/G2UQH

    Any advice?

    Thanks in advance for your help!

    Regards,

    Asen

    #2124032
    David
    Staff
    Customer Support

    Did you include a space in your before text label:

    https://www.screencast.com/t/an11QyNtXj

    #2124049
    Asen

    Now I did added a space after “Last Updated On” and it works like a charm.
    Thanks for the heads up.

    Thanks very much!

    #2124081
    David
    Staff
    Customer Support

    Glad to hear that!

    #2124099
    Asen

    Actually I had to include a double space on the Last Updated on text in order for it to appear correctly when published.
    Not sure why but I’m happy with the result. https://paste.pics/G2VY2

    #2124192
    David
    Staff
    Customer Support

    Might be WP stripping a single space. Glad to hear its working for you now

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.