How can i change the time format of post so that for the post of same day it shows as hours ago and for posts posted before it shows date of posted. Kindly help me on urgent basis.
Hi ravijain,
You can do that in the following manner.
$timediff = human_time_diff( get_the_time( 'U' ), current_time( 'timestamp' ) );
if ( strpos( $timediff, 'day' ) === false ) {
echo $timediff.' ago';
} else {
echo get_the_time();
}