I am not sure how you are changing the location, but I changed:
$station = ‘KBJC’;
to
$station = ‘LPPT’;
without any problems. Maybe I need some more clarification as to what you are doing.
i mean i changed the stations like what you did, but it seems like if you have just changed the location like say in the past 5 mins, then if you try again, you get warning messages saying that header already started…
No, that might be a problem with your editor adding some undesired whitespace. There is no caching so changes are immediate. I have changed the location numerous times over the months I have used the hack and never once had a problem with headers. I use EditPad Lite as my editor of choice – *never* Notepad.
Wow, you’re right. There were whitespaces added unbeknownst to me.
The problem is that i use Dreamweaver at home and then when i am at work, i have no choice but to edit it direct from my host’s cpanel.
So anyone that encounter this problem also, remember to check for whitespace
This is a stupied newbie questions but hopefully you can help.
I’ve downloaded the weather files and ftp’d them over. Now all I need to do is update my files to add ‘weather’. But, the step that has you adding it to my-hacks.php is where I’m lost. I don’t have that files, guessing I need to create it. Never created a php file, only opened and changed them. Are there special tags I need to use? Where do I put the file when it’s created?
Please help, thanks.
It is just a file that is called my-hacks.php and looks like this:
<?php
all the hacks
?>
Make sure there is no whitespace ( ” <?php” or “?> “) and that you turn on my-hacks in the options.
Anonymous
Hi, don’t know if this has been answered already; if it has, please point me to the link! =) I was wondering how I would go about having 2 weather reports on top of each other, for two cities. (newbie)
Do you know any php at all? If you do, maybe I can walk you through how to modify wp-weather. It is just a matter if making it so functions are not redeclared.
I’m getting the following error when trying to add weather.
Fatal error: Call to undefined function: show_wp_weather() in /home2/bbenjami/public_html/index.php on line 68
Here is my-hacks file
<?php
include_once(‘weather/weather.php’);
?>
That anonymous was me, thanks for replying so quickly! No, I don’t know php, I learned a little bit from customizing my wordpress, but I wouldn’t be able to do anything without help. How complicated would it be to explain it? Thanks. =)
star: Not too hard. If you do what I posted above, you will get “cannot redeclare” errors for a couple of functions in weather.php. For each function that causes an error you will have to wrap the function with:
if (!function_exists(‘speed’)) { // add this
function speed($part, $unit,$wind_unit) {
blah-blah-blah
}
} // add this
You will have to do the same with function “get_heat_index” and “get_wind_chill”
benjellos: In WP under Options|Miscellaneous did you check “use legacy my-hacks” at the bottom of the page?
Thanks Beel! It worked beautifully. Now I have two, but they’re both under the same city name…how do I change the name for the second one?