Timestamp problems
-
If the site is not on GMT (and even sites in the UK are only on GMT for half the year!) the timestamp used by the plugin is wrong. This doesn’t manifest so much with days, but is obvious on the creation of new questions and answers.
I have seen this reported before, but the suggested fix doesn’t work. A fix that does work is in three parts, as follows:
1. In
/templates/content-question.php
change this line:$time = human_time_diff( get_post_time( 'U' ) );
to this:
$gmt_timestamp = get_post_time( 'G', true, $post ); $time = human_time_diff( $gmt_timestamp );
2. In
/templates/content-single-question.php
find the line<div class="dwqa-question-meta">
Create a new line immediately below that, and insert this:
<?php $gmt_timestamp = get_post_time( 'G', true ); ?>
Then find the code
human_time_diff( get_post_time( 'U' ) )
and replace it with
human_time_diff( $gmt_timestamp )
3. Find
/templates/content-single-answer.php
and make the same fixes as in/templates/content-single-question.php
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Timestamp problems’ is closed to new replies.