After adding “Last Update date”, error in date on user profile
-
Hey,
I am running a snippet in backend to replace the published date to Last update date.Last update feature is working perfectly and that’s fine. But when we are visiting the author profile then it is showing us that the blogs published are 54 years ago.
The snippet which I am using is:
function et_last_modified_date_blog( $the_date ) { if ( 'post' === get_post_type() ) { $the_time = get_post_time( 'His' ); $the_modified = get_post_modified_time( 'His' ); $last_modified = sprintf( __( 'Last updated on %s', 'Divi' ), esc_html( get_post_modified_time( 'M j, Y' ) ) ); $date = $the_modified !== $the_time ? $last_modified . ' ' . $published : $published; return $date; } } add_action( 'get_the_date', 'et_last_modified_date_blog' ); add_action( 'get_the_time', 'et_last_modified_date_blog' );
What could be error and possible solution? Or any alternative snippet I can use.
Website Link: https://cshub.in/
The page I need help with: [log in to see the link]
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘After adding “Last Update date”, error in date on user profile’ is closed to new replies.