Inspiration For Creative Minds
Home » Labs » How to display twitter like time in WordPress site  

Filed under Labs

If you want to show time format in 1 day ago, a month ago etc. then here is the code. For showing the date in twitter like format just copy below code to your functions.php in WordPress theme and call the function where you want to show date.

function titter-like_time( $type = 'post' ) {
        $d = 'comment' == $type ? 'get_comment_time' : 'get_post_time';
        return human_time_diff($d('U'), current_time('timestamp')) . " " . __('ago');
It's only fair to share...Share on Google+Tweet about this on TwitterShare on Facebook

Posts you may like: