Bowen Zheng
asked 8 years ago

Hi,

I’m using DW Question Answer plugin for my website with a custom theme. But whenever someone post a question, the time is totally wrong. Something posted just now could say it’s from 5 hours ago. I checked the forum but only found solutions for DW Focus theme or ones not working. Please let me know what I should do, thanks!

1 Answers
DominicStaff
answered 8 years ago

To resolve this issue, you can open the content-single-question.php file and find the line 19.
Replace the following code:

<?php printf( __( '<span>%s%s %s asked %s ago</span>', 'dwqa' ), dwqa_get_author_link( $user_id ), get_avatar( $user_id, 48 ), dwqa_get_author(),  dwqa_print_user_badge( $user_id ), human_time_diff( get_post_time( 'U' ) ) ) ?>

With new code:

<?php printf( __( '<span>%s%s %s asked %s ago</span>', 'dwqa' ), dwqa_get_author_link( $user_id ), get_avatar( $user_id, 48 ), dwqa_get_author(),  dwqa_print_user_badge( $user_id ), human_time_diff( get_post_time( 'U' ), current_time('timestamp') ) ) ?>

And open the content-single-answer.php file. Find the line 23.
Replace the following code:

<?php printf( __( '<span>%s%s %s asked %s ago</span>', 'dwqa' ), dwqa_get_author_link( $user_id ), get_avatar( $user_id, 48 ), dwqa_get_author(),  dwqa_print_user_badge( $user_id ), human_time_diff( get_post_time( 'U' ) ) ) ?>

With new code:

<?php printf( __( '<span>%s%s %s asked %s ago</span>', 'dwqa' ), dwqa_get_author_link( $user_id ), get_avatar( $user_id, 48 ), dwqa_get_author(),  dwqa_print_user_badge( $user_id ), human_time_diff( get_post_time( 'U' ), current_time('timestamp') ) ) ?>

Note: If you still face there issue, you can send me username & password of your site, I will help you resolve this issue.
Hope this helps!

bowen_zheng
replied 8 years ago

After using this, it still won’t work. Do I need to grant you admin access for the account?

dominic Staff
replied 8 years ago

ok, I will help you resolve this issue now.

inimistdev
replied 7 years ago

This issue arise due to timezone. If your site language is English (United States) then you need to replace these lines of code in your template files.

To resolve this issue, you can open the content-single-question.php file and find the line 19.
Replace the following code:

<?php printf( __( '%s%s %s asked %s ago’, ‘dwqa’ ), dwqa_get_author_link( $user_id ), get_avatar( $user_id, 48 ), dwqa_get_author(), dwqa_print_user_badge( $user_id ), human_time_diff( get_post_time( ‘U’ ) ) ) ?>
With new code:

<?php printf( __( '%s%s %s asked %s ago’, ‘dwqa’ ), dwqa_get_author_link( $user_id ), get_avatar( $user_id, 48 ), dwqa_get_author(), dwqa_print_user_badge( $user_id ), human_time_diff( get_post_time( ‘G’ ), current_time(‘timestamp’) ) ) ?>
And open the content-single-answer.php file. Find the line 23.
Replace the following code:

<?php printf( __( '%s%s %s asked %s ago’, ‘dwqa’ ), dwqa_get_author_link( $user_id ), get_avatar( $user_id, 48 ), dwqa_get_author(), dwqa_print_user_badge( $user_id ), human_time_diff( get_post_time( ‘U’ ) ) ) ?>
With new code:

<?php printf( __( '%s%s %s asked %s ago’, ‘dwqa’ ), dwqa_get_author_link( $user_id ), get_avatar( $user_id, 48 ), dwqa_get_author(), dwqa_print_user_badge( $user_id ), human_time_diff( get_post_time( ‘G’ ), current_time(‘timestamp’) ) ) ?>

Dominic Staff
replied 7 years ago

Awesome, Thank for your help, my friend.

Powered by DW Question & Answer Pro