You can do:
echo str_replace('mins', 'minutes', human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' ago');
Update:
The same using filter as suggested:
add_filter('human_time_diff', 'new_human_time_diff', 10, 2);
function new_human_time_diff($from, $to) {
// remove filter to prevent the loop
remove_filter('human_time_diff', 'new_human_time_diff');
$timediff = str_replace('mins', 'minutes', human_time_diff($from, $to) . ' ago');
// restore the filter
add_filter( 'human_time_diff', 'new_human_time_diff', 10, 2);
return $timediff;
}
echo human_time_diff(get_the_time('U'), current_time('timestamp'));
Related Posts:
- Changing the post date and time with function
- Converting a dynamic piece of code using WordPress Loop into a static one using Post ID
- Update all comments time to random dates?
- Force the “Choose from the most used tags” meta box section to always be expanded
- Calling Different Custom Post Timestamps in a table
- Change all author links in Blog roll
- Using system date format
- saving/reading custom field value does not work – no value gets POSTed
- Set a post expiration and delete a post when expirate
- Display Updated Date Instead of Published Date
- How do you update post date (year only) in a separate custom field?
- How to hide meta from search result only on pages?
- Check if user has avatar
- Run function after post is updated
- How to check if post meta key exists or not in wordpress database
- using wp_update_post on save_post
- Update all posts automatically when using post_meta
- Query posts from current year
- How to batch update post content with custom post meta value
- List only child categories a post is in, of a specific parent category
- Setting post meta data to random value during post status transition / on publish
- How to change post status from publish to draft using hook in wordpress?
- How to output comments number of a post per day?
- Custom wp_trim_words() function not trimming right
- Does WP get all post_meta on POST page?
- Why does `url_to_postid` return 0 when testing `page_for_posts` Page?
- How can I display a specific user’s first published post?
- Sanitizing `wp_editor();` Values for Database, Edit, and Display
- Delete Post From Front-End and attachment permanently
- Limit function to specific post category
- Function to show random posts from a category
- PHP Notice error (when on 404 page)
- How to permanently delete a post meta entry?
- Display post from specific date
- Action hook for new pending posts?
- Uppercase first sentence in every post
- Ajax posts filter by date, comments, top views, top likes
- Why content_arr[‘extended’] removes paragraph tags?
- If modified on same day, show only time
- How can I sort posts by the date and a custom meta field?
- Get Meta Key Value While Saving Post
- Meta value does not save for scheduled posts
- How to compare two posts including their meta fields on a scalable base?
- Display post x of y within category
- WordPress Automatic Filename Changer
- Order posts alphabetically: how to set order=asc in mysql query?
- How to automate featured posts number? [duplicate]
- How to save meta checkbox WordPress
- Changing default WP-Site creation date
- wpColorPicker – problem with implementation to post meta
- Defined function isn’t showed on page
- Update post meta within save_post action
- WordPress 302 Redirect to Random Product/Post/Page
- Getting Whitescreen when publishing a post [closed]
- Add code to a specific post’s content
- Custom permalink for each post
- Modify this line to give alternate format date?
- Is there a way getting post fields using `transition_post_status`
- Related Posts: Changing Function For Posts Per Page
- Optimize CPT-function with a loop
- The loop starting at a certain ID
- Making a wordpress page print friendly
- Get post publishing date from within custom HTML block
- Set Default Post as Parent Child (Nested) Relation
- I need to create “View Profile” and “Edit Profile” links by incorporating the Post Title/ID, but can’t seem to manage it
- Featured Images most often doesnt appear
- How to bulk Update URLs to new values?
- WordPress Sticky Post Count “Fix” Breaking Pagecount by 72 pages!
- Function is printing twice – any suggestions?
- How to retrieve all meta data directly from the $post object? Such as $post->related_topics?
- I want to change the WordPress comments file
- Excluding tag Link from html tags in Post content
- Save All Post Permalink From A Specific Category into a .txt file
- Changing a users posts to drafts upon role change
- How to Display Most View Post in the template file?
- Show post excerpt
- How do I apply a wordpress function to something with no ID inside an archive page?
- Show all posts from the tags without having to set all of them
- Trim excerpt to first paragraph
- Best Way to detect unique posts in wp rest api
- post_name is not stored until post is published… where should I store my slug until it goes live then?
- Skip posts, but keep posts per page
- Show posts between two Custom Fields date
- How to display an icon when a new post is published and then remove it when a specific time past?
- Call image from post on index page?
- Ordering posts alphabetically by meta keys and title
- How to edit label_submit styling?
- Where should get_post_meta() go to get $post->ID get_post_meta() is empty and $post->ID & get_the_id() are working
- How to organise post by category and date
- How to limit the number of results for all query_posts on mysite
- User driven content problems
- How to change text (date) in post base on the day
- Notify Author of the post if admin deletes his post and perform some function
- How do we display a certain category type on a page while hiding all others?
- If meta_key exists then don’t select this post?
- How to remove a date from wordpress post
- What function does the loop of displaying posts?
- how show post date for specific post?
- Show Next/Previous without Link
- Filters do not work when there are multiple (one works)