How do I override the default template with a custom version?
1. Create the directory ‘weather’ in your theme directory. If you’re using child themes, create ‘weather’ in the parent theme directory.
2. Create ‘wordpress-weather.css’ in the new directory. Your css will be loaded instead of the default ‘resources/weather-display.php’.- Because the default template spits out basic unordered lists with lots of classes to hook to, this may be all you need.
- The default css is compatible with the default 2010 theme. You will most-likely need to adjust the css for your theme.
- The weather data comes in the form of the array $data.
- The weather data comes in the form of the array $data.
5. Create ‘wordpress-weather.js’ in the new directory. Your javascript will be loaded instead of the default ‘resources/wordpress-weather.js’.
- In this default file, ajax on jQuery is used to update user-chosen locations, so in using a custom-built ‘weather-display.php’, it is likely that you’ll need to update DOM selectors.
How do I translate the plugin?
1. Rename the translation file
- * Make a copy of ‘wordpress-weather.pot’ in ‘wordpress-weather/lang/’.
- * Open ‘wp-config.php’ from the Wordpress root folder.
- * Find where WPLANG is defined around line 72. For instance, WPLANG set to French would look like this:
define ('WPLANG', 'fr_FR'); - * Add the language code to the name of the WPW translation file and change the extension. For the French example, the new filename is ‘wordpress-weather-fr_FR.po’. Use this format for any language.
- * Poedit is available here: http://www.poedit.net/download.php
- * Upon saving, Poedit creates a new translation file with extension .mo.
- * The full path is probably ‘wp-content/plugins/wordpress-weather/lang/’


34 Purchases
17 Comments