• Hi everybody, i’m using a function human_time_diff to display how much time gone till post was published, how can i translate text of this function to the other languages?

Viewing 1 replies (of 1 total)
  • Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    How are you using the function to display the text? What is the phrase you are using?

    One way I can think of would be something like:

    $output = sprintf( __( '%s days ago', 'text-domain' ), human_time_diff( get_the_time('U'), current_time('timestamp') ) );
    
    echo '<span class="time-diff">' . $output . '</span>';
Viewing 1 replies (of 1 total)
  • The topic ‘function human_time_diff’ is closed to new replies.