How to Convert Date to Time ago WordPress

This Snippet is supposed to add in single.php, index.php or any other template within the loop. Don’t you think it would be finest thing to display on post where you can show post like “1 hour ago, 2 hour ago, 1 day ago” etc.

echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' ago';

via Codex , Thumbnail image via inspirationde

Maan
Maan

21 year old designer, blogger and front-end developer. love to share creative design and inspiration.

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

div#stuning-header .dfd-stuning-header-bg-container {background-image: url(http://www.downgraf.com/wp-content/uploads/2017/04/login-back.jpg);background-size: cover;background-position: center center;background-attachment: scroll;background-repeat: no-repeat;}#stuning-header div.page-title-inner {min-height: 500px;}