Archived topic
Post Updated Date - Not Showing Up
7 replies · Started by Abdul on November 9, 2022
I have added this code in the Code Snippets
add_filter( 'generate_post_date_show_updated_only', '__return_true' );
And this one, too, in the CSS
/*New Code for Updated Date*/
.posted-on .updated {
display: inline-block;
}
.posted-on .updated + .entry-date {
display: none;
}
.posted-on .updated:before {
content: "Last Updated on ";
font-weight: bold;
}
.entry-header .entry-meta > *:not(:last-child):after {
content: " | ";
}
/*End Code*/
But still it is not working
Hi there,
your site is using WP Show Posts and a Header Element so:
1. Add this PHP Snippet to change the Post date in Theme archives and the page hero:
add_filter( 'generate_post_date_show_updated_only', '__return_true' );
function post_modified_date() {
return get_the_modified_date();
}
add_shortcode( 'modified_date', 'post_modified_date' );
2. Add this CSS to change the front page dates:
.wp-show-posts-updated {
display: block !important;
}
.wp-show-posts-entry-date {
display: none;
}
home page is working fine now, but when I open the article, it still shows the original publish date.
not showing the updated current date.
Can i see a link to a post ?
Added the link in the private area.
same article on the homepage shows as November 4, 2022
Ok
1. In Appearance > Elements edit the Single Post Hero.
2. Select the Post Date and in the Block Toolbar data options change the Date type to Updated
Working now, Thanks David
Glad to hear that!