display-posts-shortcode
display-posts-shortcode copied to clipboard
date_format="relative" is relative to UTC not site current time.
return human_time_diff( $date ) . ' ' . __( 'ago', 'display-posts' );
needs to be:
return human_time_diff( $date, current_time( 'timestamp' ) ) . ' ' . __( 'ago', 'display-posts' );
Otherwise the relative time returned is against the server time() usually set to UTC so the displayed relative time is not correct.
It should be relative against the current time for the site which if offset to the timezone set by the user in there settings.
I hope I have explained this clearly!