Site logo

Archived topic

How to show Last Updated wording and new date when updating a blog post

16 replies · Started by Adrian on March 25, 2023

Viewing posts 1–15 of 17

Hi,

How can I make a change to GeneratePress that enables the wording 'Last Updated' followed by the new date on my blog posts please? At the moment my blog posts only show the original post submission date. I would like users to known that my content gets updated.

Thanks.

Hi there,

quick question do you want to only show the one date ? ie. the most recent date.

Hi David,

Yes, I think just showing the 'Last Updated' (i.e. most recent) date is all I need.

Thanks David.

Just to confirm, I need to add the following to the additional CSS section in Customize:

add_filter( 'generate_post_date_show_updated_only', '__return_true' );

.entry-meta time:before {
content: 'Last updated: ';
}

Already sorted. Apologies, my brain was on a go slow. Not tested yet but should be ok. Will confirm shortly.

Ok, just tested and after amending a post I find that the post just shows the words Last Updated, followed by the original post date instead of the new date following a change to the post. How do I get around that please?

1. Make sure cache is cleared.

2. Remove this PHP for now so that I can check if the updated date is logged:
add_filter( 'generate_post_date_show_updated_only', '__return_true' );

3. Link us to the post.

Thanks!

I can see both dates in the HTML.

Now can you turn on the PHP code?

Let me know!

no change Ying

The PHP code doesn't seem to be working, I can still see two dates.

How did you add the PHP code?

And can you temporality disable your cache plugin?

I used WPCode Code Snippets plugin. Cache plugin also disabled.

This archived topic is closed to new replies.