- This topic has 8 replies, 3 voices, and was last updated 1 year, 11 months ago by Stephen.
-
AuthorPosts
-
April 9, 2022 at 12:41 am #2182780steven
Is it possible to get your theme to display last modified date on posts?
I regularly go back through my old posts and update them.
This would be a massive boon for all your users. It would help with SEO, CTR in SERPS, and let readers know that the article they are reading is up to date.
I’ve spent an hour trying to get this working with various bits of code, and finally just installed this plugin after none of it worked:
It doesn’t display on the post though – I checked! As far as I know, it’s supposed to add rich text markup to the post. I didn’t see any either.
And I’d rather not use a plugin at all.
So can you help with this? It would be massively helpful…
April 9, 2022 at 2:47 am #2182862DavidStaffCustomer SupportHi there,
you can add the snippet provided here:
https://docs.generatepress.com/article/generate_post_date_show_updated_only/
Then all dates will be the latest date.
April 9, 2022 at 3:13 am #2182884stevenThanks David,
Sorry if this is obvious but add the snippet where?
Also does this add structured data markup schema so that Google et al are encouraged to add the markup to the serps? That’s the biggest benefit by far..
April 9, 2022 at 3:37 am #2182896DavidStaffCustomer SupportSorry – that code is PHP and this doc explains how to add it:
https://docs.generatepress.com/article/adding-php/
If you want json-ld structured data then you would need a SEO or schema plugin that provides json-ld
May 18, 2022 at 10:15 pm #2224844StephenHi David,
I’ve just bought the premium version of GeneratePress hoping this would be a built-in feature I could activate by checking a checkbox. Sadly, it isn’t. So I’ve used the code you provided and the snippet plugin to get it working. However, I would like to display the text “Last modified on” or something similar before the date. Please can you provide the code to do this?
And do you have any plans to include these settings within the theme options?
Many thanks,
StephenMay 19, 2022 at 3:39 am #2225178DavidStaffCustomer SupportHi Stephen,
our direction is moving these kinds of changes to block based editing using the Block Element.
Here is an example to build your own Post Meta:https://docs.generatepress.com/article/block-element-post-meta-template/
Does that method work for you?
If not, let me know and ill provide then PHP.
May 19, 2022 at 9:59 pm #2226172StephenHi David,
Thanks for your reply.
I got it to work using the Block Element but it took me around 30 minutes of fiddly work as I also wanted a downpipe | between my name and modified date so had to find the HTML for that. For somebody like me, who doesn’t build sites for clients, having a simple checkbox/option inside the Customizer would be a much simpler option. Especially as I want to do this on a few sites.
Anyway, it’s done! Thanks for your help.
Cheers,
StephenMay 20, 2022 at 5:00 am #2226516DavidStaffCustomer SupportSorry to hear of your frustration, but glad to hear you got it to work.
If theres a specific style you want to replicate across your sites, feel free to open a new topic and share us a link and we can take a look at the best option.
May 20, 2022 at 11:12 am #2227110StephenThanks, David.
I will do.
-
AuthorPosts
- You must be logged in to reply to this topic.