Give this a try:
if(get_the_modified_date('zY')==date('zY')) {
the_modified_date('g:i a');
} else {
the_modified_date('F j, Y'); echo ' at '; the_modified_date('g:i a');
}
It checks that the modified date is the current day. If it is, it only displays the modified time. Otherwise it displays both the date and time.
Related Posts:
- Update post date on every new comment?
- How to output comments number of a post per day?
- How can I show many posts an author has per week?
- Update all comments time to random dates?
- Changing default WP-Site creation date
- Date is wrong on ‘all posts’ page
- Bulk update published posts date randomly using wp-cli?
- Set a post expiration and delete a post when expirate
- How do you update post date (year only) in a separate custom field?
- How to display a certain template element only for posts published within certain time range?
- How to get posts published between a date and today?
- Connection lost. Saving has been disabled… (Updating Posts/Pages)
- Is it possible to Schedule Attachments in WordPress?
- Allow variable amount of comments before pagination
- order posts by date like craigslist
- get comments and get posts in loop
- Updating a post without escaping ampersands?
- One comment per user email per post
- Can’t show comments count per post outside loop
- Only display posts with comments
- How to display an icon when a new post is published and then remove it when a specific time past?
- Hide comments awaiting moderation from user who submitted the comments
- How to get the latest posting time of archived pages in WordPress?
- Can wordpress differentiate between added and updated posts?
- Including new Javascript only after a comment is made
- How to insert current date/time in the content of a post?
- Display posts with comments closed, with pagination?
- Display post from specific date
- XML-RPC and post_date
- Posts vs. Pages
- count the total number of comments the user has received for his published posts
- Replace ‘published on date’ with ‘modified on date’ on Posts
- pre_get_posts query between 2 dates (date stored in custom post meta)
- How to Orderby Comments by post title?
- Email entire post contents
- Query get post,how to add comment box
- Enable Comments Box On Custom Post Type
- Prevent scheduled post being published if date/time is past current date/time
- Move comments only from one WP installation to another
- Second comments section for one post/page
- Get all images in post and comments like Twitter before post title
- Showing author page if user has no post
- WordPress Comment posting problem
- How i can limit period of post publication?
- What do these phpMyAdmin errors mean on my WordPress databaes?
- Internal post link creates comments on its own
- Worpdress function for difference dates
- Show comment number per author per day
- Get all comments of author’s posts
- SQL Command for restoring trashed comments
- Hide comments and posts posted by other user
- What date to use as a post date? date_gmt or modified_date_gmt
- wp_update_post creating revisions instead of updating the post
- tribe_get_start_time displays the current date and time on other post types than tribe_events
- Get the most recently modified post date of most recently modified post
- Assigning Two Different Post Dates For Single Post
- Modify this line to give alternate format date?
- Is it advisable to use $post->comment_count instead of get_comments_number( $post_id )
- Add “Posted on” to post date
- change the post time on multiple posts
- Can WordPress handle following functionalities?
- Access last visit time to a post
- If post exists, make it a comment in existing post with same name?
- How to get post id of last approved comment?
- Post navigation using date
- Get post publishing date from within custom HTML block
- Post date automatically +100 years into the future
- Allow / show post comments in category pages
- If Post Published Date or Modified Date is 1 Year or Older, Display Notice on Post Page
- how to show comments only author which send own posts in wordpress
- Merge get_comments & get_posts into a single query
- Change Old WordPress Post Date Year
- How can get the last post date of the user?
- wp_trash_post() duplicates post to trash
- Need to display a Jan 1st post as the site’s front page on Jan 1st, and Jan 2nd post as front page on Jan 2nd etc
- Display Updated Date Instead of Published Date
- I want to change the WordPress comments file
- Bulk Post update_post_meta
- How to hide meta from search result only on pages?
- How do I display posts ordered by a date custom field?
- Set post beginning date and final date
- Skip posts, but keep posts per page
- How to display an icon when a new post is published and then remove it when a specific time past?
- Some comment box wordpress in 1 post [closed]
- No comments on static front page
- Trash a post, send associated comments into the trash bin (change status)
- How to organise post by category and date
- How can I get a comment ID on Submit?
- Display metabox with date
- Get first comment link on the post itself
- Get url/link to latest comments in a post
- Display only posts with comments
- 2 tick boxes appearing below comments
- How to change text (date) in post base on the day
- Comment time is same as the post time
- Admin moderates ALL comments (including post author)
- How can I show the positive and negative comments for a same post separately?
- how show post date for specific post?
- Simple shortcode to check if a user has commented on a certain post
- date_query returning only the most recent post instead of the post published before today