- This topic has 20 replies, 2 voices, and was last updated 7 months ago by
David.
-
AuthorPosts
-
May 28, 2020 at 2:06 pm #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.
May 28, 2020 at 8:45 pm #1305813Leo
StaffCustomer SupportHi there,
Can you try the code here?
https://docs.generatepress.com/article/generate_post_date_output/#only-show-updated-dateLet me know 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/May 29, 2020 at 1:34 am #1305997vanya
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.May 29, 2020 at 8:15 am #1306532Leo
StaffCustomer SupportI’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/
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/May 29, 2020 at 1:37 pm #1306964vanya
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?
May 29, 2020 at 5:16 pm #1307100Tom
Lead DeveloperLead DeveloperAre 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>
.Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMay 30, 2020 at 2:37 pm #1308117vanya
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
May 30, 2020 at 2:44 pm #1308122vanya
Resolved.
I referred this post : https://generatepress.com/forums/topic/make-a-space-between-the-post-date-and-the-authors-name/
Thanks 🙂
May 30, 2020 at 4:09 pm #1308162Tom
Lead DeveloperLead DeveloperGlad you got it working 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMay 31, 2020 at 7:59 am #1308801Mikael
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
May 31, 2020 at 2:28 pm #1309139Tom
Lead DeveloperLead DeveloperHi there,
You would copy this code: https://docs.generatepress.com/article/generate_post_date_output/#only-show-updated-date
And add it using one of these methods: https://docs.generatepress.com/article/adding-php/
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMay 31, 2020 at 10:02 pm #1309344Mikael
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?
June 1, 2020 at 9:02 am #1310030Leo
StaffCustomer SupportTry 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.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/June 1, 2020 at 9:16 am #1310045Mikael
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
June 1, 2020 at 1:54 pm #1310318David
StaffCustomer SupportHi 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.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.