Site logo

Archived topic

Last Updated in meta data

20 replies · Started by vanya on May 28, 2020

Viewing posts 1–15 of 21

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.

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.

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?

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

Glad you got it working :)

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

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?

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

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.

This archived topic is closed to new replies.