CodeCanyon

Wordpress Weather

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.
3. Create ‘weather-display.php’ in the new directory. Your markup will be loaded instead of the default ‘views/weather-display.php’.
  • The weather data comes in the form of the array $data.
4. Create ‘weather-display-sidebar.php’ in the new directory. Your markup will be loaded instead of the default ‘views/weather-display-sidebar.php’.
  • 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.
2. Using Poedit, open the new translation file 3. Translate the plugin’s terms and save.
  • * Upon saving, Poedit creates a new translation file with extension .mo.
4. If they are not already there, place the new .po and .mo files in ’/wordpress-weather/lang/’ in your Wordpress installation on your server.
  • * The full path is probably ‘wp-content/plugins/wordpress-weather/lang/’
5. Use the plugin and confirm that the terms are translated.
by
by
by
by
by