In the main loop in index, to display the date like you are asking use:
<?php printf( _x( '%s ago', '%s = human-readable time difference', 'your-text-domain' ), human_time_diff( get_comment_time( 'U' ), current_time( 'timestamp' ) ) ); ?>
You can read more about it: https://codex.wordpress.org/Function_Reference/human_time_diff
Related Posts:
- What is the use of to_ping and pinged column?
- Prevent Authors from viewing each others Posts
- Listen to Post action
- Export WordPress Posts and Meta Information in CSV format
- How to add post count to wp_nav_menu?
- Posting From Apple Aperture?
- How to know if get_posts() failed?
- how to show all post in my page-grid.php template page
- How to add padding between posts
- eBooks download website, page or post?
- Remove whitespace at the end of posts?
- Add few specific post ids to wp_query
- generate unique slug while inserting post
- Add filter-by-tag in the all posts admin console page
- Can I hide a specific post from latest posts page?
- get posts and postmetas in assoc array
- user contributed content as custom post types
- Is 30 posts/sec considered slow for wp_delete_post?
- How to load a different header based on post format?
- Latest 5 posts (custom post type), each post different CSS
- How to Use PHP Code In-Page?
- Add scripts on custom post add/edit pages Not Working
- Getting current post ID in functions.php
- Understand post type
- Getting content from a single *page* of a post
- How can I show wordpress posts based on author?
- previewing my posts on static page?
- Remove certain post-formats from showing in blog?
- Avoid duplicate post from same Taxonomy
- Email Post Attachment on wp_insert_post Action
- Can I divide the pages into categories?
- Display featured products by category
- Setting posts_per_page for taxonomy term template
- Change post order random through out the entire WordPress
- Posts gathered from WPEMatico feeds are being mixed in different languages. Polylang is used for language separation
- How to render arbitrary post without displaying it [closed]
- Turn On Comments On Custom Post Types in Directory Theme
- Automatically attach image to post if they have the same title
- Shortcode and whitespace formatting problem
- Using wp_list_pages() after calling query_posts()
- Delete pubished and unpublished posts with wp_delete_post?
- How to remove in-line style of WordPress’s post content only?
- How can I add content to a post that only shows in single-post mode?
- How to Get Posts, Including Private Ones?
- Find the Post ID of a post from another website
- Proper way of establishing custom landing pages in WordPress
- How do I show posts from another wordpress installation?
- How can I determine where I want to edit in the backend (server)
- Archive template combined with post slider and regular posts
- Create a custom posts page
- How to show a custom taxonomy in the theme?
- How to import nested categories from XML file?
- Exclude some posts from displaying in wp_query based on some condition
- register_post_type permalink
- Show posts by quarter
- Inserting an example of the last 3 post on to the homepage
- Make ‘blog’ page show content as well as posts underneath it
- Cant’ Grab WordPress Built-in Posts Through Loop
- Sidebar limiting to 10 posts?
- Attachment image single page
- Short link to read complete post
- Display content between two dates?
- How to associate a custom taxonomy to a post multiple times
- Post date automatically +100 years into the future
- Can I show category name in url for only one of my categories?
- How to let a user create a post by submitting a POST form?
- Automatic duplicate/copy of post to a related page in WordPress
- Change Old WordPress Post Date Year
- How to fix wordpress blog post error? Can anyone help to fix this issue?
- Query prints posts without specific categories
- Private post caught in endless redirect loop
- Foreach issue in get_posts function
- migrate only recent posts
- Disable pagination in posts and pages
- wpautop filter off for pages but on for posts
- post categories – how to show only categories with a specific parent id
- Creating a “category” of featured posts
- How do I create a ‘selection’ criteria list’ that will then dictate which posts are generated when the user presses search?
- Post URL duplication adds numerical value
- Is it possible to display QUICK EDIT as default for all posts in wp-admin/edit.php page?
- get “read more” with custom DB query like you would with WP Query
- Create custom URL with different levels
- some posts being displayed as pages
- Assign specific ads to specific categories/posts
- Reading Setting Not Working for Number of Posts
- Body text disappearing in random posts
- Get part of a page url
- Add default content to post (for specific category)
- Displaying posts on Homepage
- Adding a time stamp on post view
- Where are my posts linked to? I keep getting a Not Found Error, and I have no single.php page
- The post order is different for logged-in and non-logged-in users? [closed]
- Display one post randomly from category on home page
- Change a div background color on Post ID
- How to show all Posts Image, Title and 3 line description on main page?
- CSS code for “inserting a custom post divider” after each post
- Read more opens attachment
- How to show video from post on the all posts page?
- Show a page counter for pagination
- WP_Query post_tilte search in posts table