Thread Starter
LS
(@lsterling03)
Ok, so I found this in the plugin code:
$forecast_temp_min_[$i] = (round($myweather_sevendays->forecast[0]->time[$i]->temperature[0]['min']));
$forecast_temp_max_[$i] = (round($myweather_sevendays->forecast[0]->time[$i]->temperature[0]['max']));
So to get today’s temps, I tried that code with time[0]:
Min Temp = <?php echo (round($myweather_sevendays->forecast[0]->time[0]->temperature[0]['min'])); ?>
Max Temp = <?php echo (round($myweather_sevendays->forecast[0]->time[0]->temperature[0]['max'])); ?
That code does return min and max temps, but the temps aren’t correct and don’t match the forecast for today on openweathermap.org’s forecast page. If I use time[1] or time[2] etc… it DOES display temps that match those on openweathermap.org’s forecast page for tomorrow and the day after. So it would make sense that time[0] should be today’s data. Do you know why the returned temps aren’t correct? Or, do you know how I can modify that code so that it IS correct?
Thread Starter
LS
(@lsterling03)
More information….
I think the above problem was a caching issue, as it now matches the openweathermap.org website’s forecast. Still, I think it should be easier to show today’s forecast without having to use custom code. It would be helpful if you just made the 16-day forecast begin with today.
But another issue I’m now seeing…
The current weather icon shows a sun, and it’s dark outside right now so it should be a moon. The forecast on openweathermap.org correctly shows a moon. I tried turning caching off and that didn’t affect it.
The last updated date says todays date at 11:59pm. But 11:59pm hasn’t happened yet. It’s only 7:15pm right now as I write this. My WordPress timezone settings are correct, but it doesn’t appear to be using the WP timezone for the last updated date. Perhaps that’s also causing the problem with the sun/moon symbol?
These issues are happening on the default no-skin template with no customizations.
Hi,
WP Cloudy doesn’t manage Moon for the moment but it’s in the to-do-list.
For current weather forecast, I don’t understand what you want.
By default, WP Cloudy can show current weather and hourly forecast…
To set cache time, go to WP Admin > Settings > WP Cloudy > Advanced tab.