Human Time Diff

Hey,

in the past you helpded me with the following function for hiero theme.
I want to echo Today if a post was created today, and Yesterday if a post was created yesrerday instead of the post date. With the older versions of WP it was working, but not with the new version. Maybe the $status is not supported anymore?

It would be great if you could give me a hint.

Thanks!!

functions.php

function hiero_human_time_diff( $timestamp ) {
$date = date('d-m-Y', $timestamp);
$today = date('d-m-Y');
$yesterday = date('d-m-Y', strtotime('yesterday')); 

// Checking the status
if ( $date == $today )
$status = 'Today';
else if ( $date == $yesterday )
$status = 'Yesterday';
else
$status = get_the_date();

return $status;
}


Hello Briesmi,

It looks like this issue requires some coding and testing, this goes beyond our support policy. It’s considered advanced customization. As an option, you can contact Codeable for this kind of service, or find a reputable freelancer on Upwork.

Kind Regards, Roman.