Roberta
asked 10 years ago

Good morning.
In DW Focus it is strangely wrong date (time) for "Ultimissime" in Headline (Under Navigation > Headline). Until yesterday were correct. Now are all "44 anni ago" (in english = 44 years ago).
I have not changed anything in the code (it should be translated into Italian "needle" in "ago", but not understanding anything of code I have not been able to do. Can you help?
Please see the following screenshots (in the image "home-adv" you can see that the time/date was correct).
The site is – Dominic knows him "unfortunately" very well 😉

5 Answers
Wilfred
answered 10 years ago

Hi Roberta,
The 1.0.4 version is up now: dw focus 1.0.4 . (sorry there was minor uploading issue)
I have fixed all the issues on your site as well. 

 

Alfian Sabri Tanjung
replied 10 years ago

Thanks Wilfred.

Roberta
replied 10 years ago

Many thanks! :flower:

Jackie Lord
answered 10 years ago

Please open file dw-focus-latest-headlines.php in folder path: wp-content/themes/dw-focus/inc/widgets/
Find and replace this following code:

 <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a><span><?php echo ' - ' . human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' ago'; ?></span></li>

with this:

 <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a><span><?php echo ' - ' . str_replace('anni','needle',human_time_diff( get_the_time('U'), current_time('timestamp') ) ) . ' ago'; ?></span></li>

Hope this helps!

Roberta
replied 10 years ago

Hello Jackie, first of all thank you for answering and sorry for bad English.
The problem is not “needle” (I did not realize that the Google translator translated the Italian word “fa” in “needle” (for example the Italian translation of “1 day ago” is “1 giorno fa”, which in any case will settle to a friend, because I do not understand anything about code, I’m just an editor) but the weather changed all to “44 years” on all the news headline. I posted recently, can not be “44 years ago.” Before, they were correct the dates of publication. I have not changed the code. know that “your” Dominic (who helped me in any problems) can be addressed on the code (I gave them the password to enter); may perhaps be successful something on that occasion?
Thanks for your patience and availability.

Roberta
replied 10 years ago

Very important and worrying!
Unfortunately I have now discovered that the dates on the home page are all wrong (if you display items are ok). Please, in addition to the problem of the date in Headline, see also this explanatory. What’s going on? Two days ago was entirely correct. It is not that something happened when Dominic amended the Code or inserted in the header of the script? I remember that I opened other tickets that resulted in changes to both the code and the script header to which Dominic worked. Please help me. Thank you.

Roberta
replied 10 years ago

Although these dates are wrong in home pageThanks.

Roberta
answered 10 years ago


Hello, I found the solution. I’ve disabled your plugin “Q&A” and dates are correct. Too bad that the plugin causes these damages …
I have seen that you have just updated to version 1.0.1 the plugin. The problem remains: Italian dates in the format continues to be wrong. Then the plugin will eliminate “Q&A”.
I hope that this report will be of help. Thanks anyway!

Roberta
answered 10 years ago

Please, take a look to the site. All the dates are wrong, set to year 1970! The date format is wrong too. I really need our help to fix this…

Wilfred
answered 10 years ago

Hi Roberta,
At the moment we could not access to your site, we will check back frequently and fix the issue for you.
Please stay calm!

Roberta
replied 10 years ago

Hi Wilfred, ok. Thanks

Wilfred
answered 10 years ago

Hi Roberta
When I accessed to your site, apparently the wrong date issue was fixed:

Roberta
answered 10 years ago

Hi Wilfred,
thus eliminating your plugin seemed all right. Today, when the site is back online, it was actually ok. Now I have just added a new article and show me the wrong dates only in “Editoriali” and in the tab of the articles, of course, always in the Homepage. I specify that I added a new article “Riforma Aler: Pavia insieme a Lodi…” and dated 16 november on the official website because it was just released two days ago. It will be entering a retroactive date that causes these problems?
Please, can you help me to solve definitively? I would be very grateful.

Wilfred
answered 10 years ago

I have here 2 ways to fix this issue:
Way 1: you can update the theme with version 1.0.4 
 
Way 2: bug fix. Please follow my instruction here:
1. Open file fucntions.php in Your site > wp-content > themes > your theme > functions.php

Delete the following code at line 321 , 322 

 add_filter( 'get_the_date', 'dw_human_time_diff', 10, 2);
add_filter( 'get_comment_time', 'dw_human_time_diff', 10, 2);

Add the following code line to line 323 

 if( ! function_exists('dw_human_time') ) { 
function dw_human_time(){
echo esc_html( dw_human_time_diff(get_the_time('c'), current_time('timestamp')) );
}
}

 
It should look like this:


 
2. Find and replace the following code:

 echo get_the_date('c');

with this one: 

 dw_human_time();

In following file:
– content-archive.php – your site > wp-content > themes > your theme > content-archive.php –  line 41, 62
– content.php – your site > wp-content > themes > your theme > content.php –  line 31
– dw-focus-categories.php –  your site > wp-content > themes > your theme > inc > widgets > dw-focus-categories.php –  line 254, 333
– dw-focus-categories.php –  your site > wp-content > themes > your theme > inc > widgets > dw-focus-categories.php –  lline 67, 141
  
5. Open file attachment.php – your site > wp-content > themes > your theme > attachment.php – line 22. 
Replace the following code

 esc_html( get_the_date() )

with

 dw_human_time();

6. Open file template-tags.php – your site > wp-content > themes > your theme > inc > template-tags.php – line 133
Find and replace the following code:

 get_the_date('c')

with this:

 dw_human_time();

 
7. Open file dw-focus-slider.php – your site > wp-content > themes > your theme > inc > widgets> dw-focus-slider.php – line 104
Replace the following code

 echo ' / '.get_the_date('c');

with this:

 echo ' / ';
dw_human_time();

Hope this helps!

 

Alfian Sabri Tanjung
replied 10 years ago

Hi Wilfred, I was download today, and says 1.0.3 version.

Roberta
replied 10 years ago

Hi Wilfred, thanks.
I am not able to modify the code. The person who should occupy if it can not do so for personal reasons before a month. 🙁
If I am giving you privately "keys" to the server you could do it? Dominic, however, has already all information.
I confirm what is written Alfian Sabri Tanjung that the version you have on your site (and I have installed) is 1.0.3.

Powered by DW Question & Answer Pro