[Support request] I want to show “Last Updated” instead of when post published

Home Forums Support [Support request] I want to show “Last Updated” instead of when post published

Home Forums Support I want to show “Last Updated” instead of when post published

  • This topic has 5 replies, 3 voices, and was last updated 1 month ago by Elvin.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2052814
    Usman

    Hello there,

    I want to show the last updated time under the post title instead of when it was published. For this, I researched a little bit and found https://docs.generatepress.com/article/show-the-updated-post-date/ this article.

    I don’t understand what to do with this CSS or other codes.

    Is there anyone who assist me in updating May 17, 2021 by USM to by USM | Last Updated August 22, 2021?

    Thanks in advance
    Looking Forward
    Usman

    #2053160
    Ying
    Staff
    Customer Support

    Hi Usman,

    Go to customize > additional CSS, copy and paste this CSS to there:

    .posted-on .updated {
        display: inline-block;
    }
    .posted-on .updated + .entry-date {
        display: none;
    }
    .posted-on .updated:before {
        content: " | Last Updated ";
    }
    .single-post .entry-meta {
        display: flex;
    }
    
    .single-post .entry-meta >span.byline {
        order: -1;
        padding-right: 10px;
    }

    Let me know if this helps ๐Ÿ™‚

    #2053383
    Usman

    Yes, it worked perfectly on single posts. Thank you Ying.

    I am looking if it works on archive pages too?

    Currently, some posts in archive pages show “August 25, 2021 by USM” while others “| Last Updated November 2, 2021 by USM”

    Thanks again.
    Usman

    #2053999
    Elvin
    Staff
    Customer Support

    Hi Usman,

    Can you link us to a sample archive page of the site you’re working on? To be sure why the CSS isn’t working for it and have a better idea on which way to approach this.

    You can use the private information text field to provide the link – https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information

    Let us know. Thanks! ๐Ÿ˜€

    A wise man once said:
    "Have you cleared your cache?"

    #2054079
    Usman

    Hey Elvin, thanks for replying.

    Here is the link: https://smartkitchens.review/grills/

    Looking Forward
    Usman

    #2054115
    Elvin
    Staff
    Customer Support

    Ah I see now. thanks.

    The posts that doesn’t display Last Updated are posts that have no history of being modified. They don’t have a modified date to display so there’s no element to display “last updated” on.

    Any specific parts you need fixed? (example: removing | on archive pages?)

    We can modify this CSS to remove | on archive pages.

    Example:

    body:not(.blog,.archive) .posted-on .updated:before {
        content: " | Last Updated ";
    }
    
    body.blog .posted-on .updated:before,
    body.archive .posted-on .updated:before {
        content: "Last Updated ";
    }

    A wise man once said:
    "Have you cleared your cache?"

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