Human Time Diff

Home Forums Hiero Human Time Diff

This topic contains 1 reply, has 2 voices, and was last updated by  Roman 1 month, 3 weeks ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #994529

    Briesmi
    Participant

    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;
    }
    
    
    #995288

    Roman
    Moderator

    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.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.