[Resolved] Last Updated in meta data

Home Forums Support [Resolved] Last Updated in meta data

Home Forums Support Last Updated in meta data

Viewing 15 posts - 1 through 15 (of 21 total)
  • Author
    Posts
  • #1305592
    vanya

    Hello Guys, I can see that this topic has been talked a lot but something is not working for me.

    I tried this https://generatepress.com/forums/topic/post-updated-date/#post-470725 but something was going wrong.

    I want to show “Last Updated” in the meta data if the post was modified.
    And show “Original Published” date if the post was never modified.

    Please help me with this.

    #1305813
    Leo
    Staff
    Customer Support

    Hi there,

    Can you try the code here?
    https://docs.generatepress.com/article/generate_post_date_output/#only-show-updated-date

    Let me know 🙂

    #1305997
    vanya

    I added all these codes in snippets separately like this – https://prnt.sc/spwvj7

    This is what I achieved https://prnt.sc/spwxc4

    The meta data now just shows published date and author name.

    I want to show “Last Updated” in the meta data if the post was updated.
    And show “Original Published” date if the post was never updated.

    #1306532
    Leo
    Staff
    Customer Support

    I’m not sure what’s included in each snippet by looking at the name unfortunately.

    Can you make sure this CSS is also added which is needed for the front end?
    https://docs.generatepress.com/article/show-the-updated-post-date/

    Adding CSS: https://docs.generatepress.com/article/adding-css/

    #1306964
    vanya

    I was able to achieve something like this https://prnt.sc/sqb4vz

    I finally need to put some space after the date

    Any code for that?

    #1307100
    Tom
    Lead Developer
    Lead Developer

    Are you using this code?: https://docs.generatepress.com/article/generate_post_date_output/#only-show-updated-date

    If so, the space comes from that extra space you see after the closing </span>.

    #1308117
    vanya

    It seems you did not got my question.

    There is no space between the date “May 29, 2020by admin”

    I need it like “May 29, 2020 by admin”

    I need space after year https://prnt.sc/sqtrjt

    #1308122
    vanya
    #1308162
    Tom
    Lead Developer
    Lead Developer

    Glad you got it working 🙂

    #1308801
    Mikael

    I followed this post and can see there is a code to get the last updated date displayed – where do I need to add this code to get it to work?

    Thanks

    #1309139
    Tom
    Lead Developer
    Lead Developer
    #1309344
    Mikael

    Thanks.

    Is there something I can add to the code so it actually says “Last updated” in front of the date?

    And if I add it to the functions.php in the child theme, does it matter where I add it or can I just add it at the end?

    #1310030
    Leo
    Staff
    Customer Support

    Try the CSS here?
    https://docs.generatepress.com/article/show-the-updated-post-date/

    And if I add it to the functions.php in the child theme, does it matter where I add it or can I just add it at the end?

    Adding it to the end should work.

    #1310045
    Mikael

    Great. Thank you.

    Can I ask why I need to add something in the functions.php file? because I tried adding just the CSS you just shared and it shows the updated date just by adding this and without adding anything to the functions.php.

    Is there something I am missing by not adding the code you shared previously to the functions.php first?

    Is the CSS just what people see but when it is also added to the functions.php Google will also read the updated date or what is the difference?

    Thanks

    #1310318
    David
    Staff
    Customer Support

    Hi there,

    by default GeneratePress outputs both the Published and Updated date – but it hides the updated date with CSS. So yes you can use some CSS to change which one is displayed.

    The PHP function changes what is output. So instead of outputting both Published and Updated dates it will only output the most recent one.

    Some say this is more likely to get Google to display the Updated date.

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