Nikolai Goncharov
asked 8 years ago

Publication date of Question “3 hours ago”, the date of publication of the comment “1 minute ago”, although they are published at one time. After 3 hours the publication date of the Question “1 minute ago” and the date of publication of the comment “3 hours ago”. How to fix it?

1 Answers
DominicStaff
answered 8 years ago

To resolve the time issue on your site you can do the following solution:

About list question page, you can open the content-question.php file, find line 17.

Replace it with the following code:

$time = human_time_diff( get_post_time( 'U' ), current_time('timestamp'));

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') ) ) ?>

Nikolai Goncharov
replied 8 years ago

Your solution does not work. May be I not correctly formulated a question.
The problem is that posting a question does not match the time set on the website

Nikolai Goncharov
replied 8 years ago

The time of publication of the issue does not match the time set on the website

Dominic Staff
replied 8 years ago

Please send me username & password of your site for further checking, I will help you resolve it.

Nikolai Goncharov
replied 8 years ago

http://www.proinzhenerku.ru
Username: vrndorvc
password: ZninPir{)pROwagon}

Dominic Staff
replied 8 years ago

I have helped you resolve this issue, you can check your site now.

Nikolai Goncharov
replied 8 years ago

compare:
http://proinzhenerku.ru/dwqa-questions/ (here the time of publication of the issue is incorrect)
http://proinzhenerku.ru/question/demo-time/

Dominic Staff
replied 8 years ago

Right now, you can check your site, I have fixed it.

Nikolai Goncharov
replied 8 years ago

Yes, but I now need a new POT file.
Also I would like to know what happens after updating the plugin. Your changes will be saved?

Dominic Staff
replied 8 years ago

you can download the new POT file here: https://www.dropbox.com/s/digio58nqwsyb7w/dwqa.pot?dl=0
About the time issue, we will update it in the next version. Or you can go to your theme folder and create a new folder , named it “dwqa-templates” .
Inside your new folder, you can copy/paste the “question-submit-form.php, content-comment.php, content-question.php, content-single-answer.php, content-single-question.php. file into the new folder.
all the change will be saved.

Powered by DW Question & Answer Pro