Hi, add this snippet to your functions.php file:
function override_time_diff() {
return '-10'; // 10 seconds
}
add_filter( 'wplmi_date_time_diff_post', 'override_time_diff' ); // for posts
add_filter( 'wplmi_date_time_diff_page', 'override_time_diff' ); // for pages
Thanks so much. I’ve added the following to the bottom of functions.php:
function override_time_diff() {
return '-10'; //10 seconds
}
add_filter( 'wplmi_date_time_diff_post', 'override_time_diff' ); //for posts
add_filter( 'wplmi_date_time_diff_page', 'override_time_diff' ); //for pages
But, the “last updated” information still doesn’t show on this post and several others as it does on this one.
Might you have any other suggestions?
Hi, as there is a near about 30 days difference between published time and modified time, you need to just change -10 in above snippet.
Just replace the above snippet with this:
function override_time_diff() {
return '-2592000'; //2592000 seconds i.e. 30 days, change it according to your need
}
add_filter( 'wplmi_date_time_diff_post', 'override_time_diff' ); //for posts
add_filter( 'wplmi_date_time_diff_page', 'override_time_diff' ); //for pages
Hope, this will definitely work.
Thanks!
Ah, I see. Ok. Thank you. That’s fabulous and does seem to be working perfectly.
One more question, if I may: Doing this sort of thing is quite new for me. Will this change get wiped out and need to be reapplied if I update the installed theme? Or, will this persist through theme upgrades?
Yes, it need to be reapplied every time if you update your theme. If you are using child theme then you don’t need to worry. It will be safe. If not, you can start using child theme or use free Code Snippets plugin to keep this code forever.
Thanks! 🙂
Ok. Great. Thanks so much for your help, again, and for that additional recommendation!