Display Twitter-like “time ago” on your WordPress


Sponsored Links






There are some ways to display twitter-like “time ago” date format in our WordPress. We can use plugin (we recommended this plugin) or we can create and write little functions to handle this. On this tricks I will show you how to created using functions. Write down this functions on your functions.php in your theme.

Display Twitter-like “time ago” on your WordPress - Megan Fox Foxy Out

Display Twitter-like “time ago” on your WordPress

function time_ago_comment( $type = 'post' ) {
	$d = 'comment' == $type ? 'get_comment_time' : 'get_post_time';
	return human_time_diff($d('U'), current_time('timestamp')) . " " . __('ago');
}

To use this functions is simple. Open your single.php, index.php or whatever you want put this code and write down this code

<?php echo time_ago(); ?>

This code using standard WordPress function human_time_diff. If you think our today tricks (Display Twitter-like “time ago” on your WordPress) useful on you. Help me share this post in your favorite social bookmarks or social networks. Thanks for UpThemes for share this great code and WP Recipes.

Photos courtesy of Popoholic

Subscribe to Full RSS Feed

RSS FeedIf you thing this article useful, please consider subscribing to our RSS Feed or e-mail updates and stay updated with us. You can also follow @WPTricksNet on twitter for latest updates.

About WP Tricks

We are WordPress Family, we collected and writed useful tips and tricks for you WordPress. We share it for you...

Related Tips and Trick from Local Data and on The Net

The Better Way Display Twitter Followers in Text

There are so many ways to Display Twitter Followers in Text, the popular way is we can use CURL method, we have writen the tutorial display twitter followers in text using CURL. But this method for some WordPress Developers said … Read More

How To Display Twitter counter in Text

Update: Better Code Display Twitter Counter Text using WordPress Api Display Twitter Counter in Text is easily in WordPress with PHP code, all need to do just write down some PHP Script in our wordpress theme, we can write it … Read More

How To Automatically add Twitter and Facebook buttons to your posts

How To Automatically add Twitter and Facebook buttons to your posts, this trick original created by Dev7Studios and I will share it again for you. Like on many many WP Tutorials that I was write on WP Tricks, you need … Read More

Tricks: Display Total Twitter Followers as Text on WordPress

Everybody blogging everybody using Twitter for Microbloging tools. On this tips, I will show you how to display your total twitter followers on your sidebar or whatever and displaying as text. All need to do is add little bit code … Read More

How To Display Total Retweets in Text without Plugin

Twitter become more popular, now every people and website have twitter account. Using twitter there are unlimited abilites, we can share our favorite post, Retweets others tweets and many more. Today WordPress tutorial will share how to Display Total

How To Autolink on Twitter Username

Now, everything have twitter account, Website, Actor, Singer, Politican, Webstore, Website, Google, Yahoo and everything on Twitter. We Have too, so follow our Twitter @WPTricksNet For us, Twitter and WordPress is the right couples. So, I will

How to display Twitter-like “time ago” on your WordPress blog

Daily recipes to cook with WordPress Twitter have a really cool built-in function that display time from now, like “3 days ago” or “more than a month ago”. read more

Source: http://www.wprecipes.com/how-to-display-twitter-like-time-ago-on-your-wordpress-blog

PHP MySql Guide | PHP Web Programming Guide, Learn PHP, MySql

Display Twitter-like “time ago” on your WordPress blog Twitter have a built-in function that display time from now, like “3 days ago” or “more than a month ago read more

Source: http://php-mysql-guide.blogspot.com/

How To Display Twitter counter in Text / WordPress Tricks & Tips

Display Twitter-like “time ago” on your WordPress. There are some ways to display twitter-like "time ago" date format in our WordPress. We can use plugin (we read more

Source: http://wptricks.net/how-to-display-twitter-counter-in-text/

The Better Way Display Twitter Followers in Text / WordPress

Display Twitter-like “time ago” on your WordPress. There are some ways to display twitter-like "time ago" date format in our WordPress. We can use plugin (we read more

Source: http://wptricks.net/the-better-way-display-twitter-followers-in-text/

How to count retweets in full text on your WordPress posts

Automatically add Twitter and Facebook buttons to your posts; How to display Twitter-like “time ago” on your WordPress blog; Display the number of tweets for each page or read more

Source: http://www.wprecipes.com/how-to-count-retweets-in-full-text-on-your-wordpress-posts


2 Responses to Display Twitter-like “time ago” on your WordPress

  1. Pingback: Tweets that mention Display Twitter-like “time ago” on your WordPress #tricks #code #functions -- Topsy.com

  2. Pingback: Display Clean Pingbacks and Trackbacks | Unlock IMEI Cellphones

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>