Updated date on the post not showing
-
I want to show the content updated date on my pages/posts, I’ve added this code.
function wpb_last_updated_date( $content ) { $u_time = get_the_time('U'); $u_modified_time = get_the_modified_time('U'); if ($u_modified_time >= $u_time + 86400) { $updated_date = get_the_modified_time('F jS, Y'); $updated_time = get_the_modified_time('h:i a'); $custom_content .= '<p class="last-updated">Last updated on '. $updated_date . ' at '. $updated_time .'</p>'; } $custom_content .= $content; return $custom_content; } add_filter( 'the_content', 'wpb_last_updated_date' );
The thing is it works on my pages and some of the posts but not on all the posts! This code isn’t working on this post:
Could anyone help me with this or is there something I have to change in the code? This post isn’t showing the updated date but the same code is working on other pages and posts!
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 ‘Updated date on the post not showing’ is closed to new replies.