Site logo

Archived topic

Display last updated date on blog posts

21 replies · Started by Rob on January 13, 2021

Viewing posts 16–22 of 22

Nice one. Glad it worked for you. No problem. :D

EDITED:

I added this to a plugin functions.php file:
add_filter( 'generate_post_date_show_updated_only', '__return_true' );

I then I added "Last Updated" prefix using .updated-date:before {...}

(The number of times this specific question was asked/answered suggests it might be time to add this feature as a GUI-able option to the Theme instead of resorting to CSS and filters). But my question now is: what's the easy way to adjust the spacing below the date line on posts (not pages)?

Thanks

Hi Lucie,

You’ll need custom CSS for this. Try adding this in Customize > Additional CSS:

.single.single-post .entry-meta {
    margin-bottom: 50px;
}

For feature requests, you can raise one here: https://github.com/tomusborne/generatepress/issues

Hope this helps!

Your welcome Lucie!

The Dynamic Block would only be available if you use a Block Element to display your entry meta.

Say for instance, you use a Block Element - Content Template to edit the layout of your archives, then, the dynamic Block would be possible. There are many more pros in using a Block Element. Example Reference: https://docs.generatepress.com/article/block-element-content-template/

I wouldn’t say it’s inferior. They’re just two different ways of doing it. Using a Dynamic Block Element would be the more “updated” and user-friendly version of doing it. It’s easier to customize too, without the need for custom CSS.

Hope this clarifies!

yes, very helpful. Thanks.

You’re welcome Lucie!

This archived topic is closed to new replies.