-
Some time ago I requested support for the same issue and you can see the old topic here:
https://generatepress.com/forums/topic/post-updated-on-to-reflect-modifiedtime/Unfortunately some time ago I noticed it is not working anymore.
I tried to add this to my child theme functions.php:
add_filter( ‘generate_post_date_show_updated_only’, ‘__return_true’ );
but I got this error message:
Your PHP code changes were rolled back due to an error on line 21 of file wp-content/themes/generatepress_child/functions.php. Please fix and try saving again.Uncaught Error: Undefined constant “‘generate_post_date_show_updated_only’” in wp-content/themes/generatepress_child/functions.php:21
Stack trace:
#0 wp-settings.php(591): include()
#1 wp-config.php(94): require_once(‘…’)
#2 wp-load.php(50): require_once(‘…’)
#3 wp-admin/admin.php(34): require_once(‘…’)
#4 wp-admin/theme-editor.php(10): require_once(‘…’)
#5 {main}
thrownI already have this in my functions.php:
add_filter( 'generate_post_date_output','tu_add_to_post_date' ); function tu_add_to_post_date( $output ) { return '<span class="date-label">Updated on </span>' . $output; }
-
Hi there,
It might be because the wrong quotation mark is used in snippet.
Try this:
add_filter( 'generate_post_date_show_updated_only', '__return_true' );
instead of this:
add_filter( ‘generate_post_date_show_updated_only’, ‘__return_true’ );
-
Thanks, Leo! Looks like this solved the issue!
-
No problem 🙂
- You must be logged in to reply to this topic.