Always Sunny is a beautiful and easy to use weather plugin, which displays the current weather and forecast via shortcodes or via widgets.
Hello there, and welcome to the Always Sunny Documentation. The Documentation covers all the information needed to use our Always Sunny Weather plugin to create beautiful WordPress widgets and shortcodes, as well as some helpful tips and tricks that will make your experience working with the Always Sunny plugin easier and more enjoyable. If you need any additional assistance while using our plugin, you can always write us on support@despotic-studio.com and our support team will be glad to help you out.
You can navigate through different sections of the Documentation by clicking on the links in the menu to the left of your screen. You will also notice that we have highlighted certain parts of the text throughout the Documentation, such as important pieces of information, useful tips, and helpful code snippets, with different formatting for an easier overview. Here are some examples of the different formatting we use for Useful Tips, and Code Snippets:
This is a useful tip
<h4>This is a helpfull code snippet.</h4>
In this first section of the Always Sunny Documentation we will go through the essential steps required to start using the Widgets and Shortcodes generated by our Weather plugin on your Website. We will explain how to install the plugin, set it up, as well as how to update the plugin. At the end of this section you will also find a set of Frequently Asked Question related to troubleshooting the plugin.


After the installation of the Always Sunny plugin you should be automatically redirected to the plugin settings page. If you activate a plugin as a part of a bulk activation, please navigate to Settings > Always Sunny tab of your WordPress dashboard.

Our plugin uses the OpenWeatherMap API to display weather forecast. It is important that you register on openweathermap.org site and get your own free API KEY. Once you have created an account on Open Weather Map website you can locate your key in the API key section.

After that just paste the key in field located in the settings page and you are ready to go.
Please be advised that if you don't generate your personal API key you will experience issues with the weather data display, since the plugin uses a key available to all users by default which will hit it's limits occasionally.
After you have entered your API Key in the Settings menu, you can then start using the Always Sunny plugin to create beautiful Weather Widgets and Shortcodes. This section will cover the options and usage of the Always Sunny Weather widgets.
To insert a Widget in any of your theme's sidebars (which may differ from theme to theme) navigate to Appearance > Widgets in your admin dashboard. And there you will locate the Always Sunny Widget. Just drag it to one of the available Widget Areas, most common one being a Sidebar area. After moving the Always Sunny Widget to a Widget area, a number of options will appear, which will help you to use and style the Widget more easily.


The Shortcode within Always Sunny plugin can be used on Pages and Posts. When you create a New Page/Post you will see a small icon of a Sun located within your TinyMCE editor. Just click on an icon and a nice user-friendly form will appear with which you can adjust your Always Sunny Weather shortcode to your preference.

The options within that form are basically the same like when adding a Widget, with almost identical functionality. Therefore we won't be repeating descriptions of those options again. If you need a reminder, just scroll to the "Using the Widget" section.

After you click on the OK button in the form, a shortcode will be generated for you. After that just save the page and visit your page to see the result. Generated shortcode will look something like this:
[despotic_always_sunny target_city="London, UK" forecast_type="four_days" units_type="metric" first_gradient_color="#dd9933" second_gradient_color="#1e73be" forecast_background_color="#8224e3" text_color_skin="light" cache_time="10"]
There are a few things that are specific to the Shortcode which you should have in mind. First one is that the Cache for the Always Sunny Shortcode is cleared when Saving a Post/Page. The other one is that the Shortcode will take a 100% of available space. Which means it could span across the full width of the page. Since that may seem a bit odd, we would suggect constraining the widgets to columns. If you are using some kind of a Page builder in your theme then you can just add the shortcode in one of the columns of your page and determine it's width like so. If not, you can set the width of your shortcode with a few lines of inline CSS code.
In this example, we are going to restrict the width of a shortcode to 70% of the available space:
<div style="width: 70%">[despotic_always_sunny target_city="" forecast_type="zero_days" units_type="kelvin" first_gradient_color="" second_gradient_color="" forecast_background_color="" text_color_skin="light" cache_time="10"]</div>
So, what we did was just wrapping our shortcode in a DIV element with width of 70%. You are of course free to adjust the width to your needs. Just bare in mind that you have to switch to a text tab within the editor when adding the code.

Similarly, you can asign a class to a DIV:
<div class="always-sunny-shortcode">[despotic_always_sunny target_city="" forecast_type="zero_days" units_type="kelvin" first_gradient_color="" second_gradient_color="" forecast_background_color="" text_color_skin="light" cache_time="10"]</div>
and then style all of the shortcodes with that class from Appearance > Customize > Additional CSS:
.always-sunny-shortcode {
width: 70%;
}
1. The City Name displayed on a Shortcode/Widget is always pointing to London, when I don't enter a Specific City Name in the City field?
If you don't enter a Specific City Name in the City field, Always Sunny Widgets and Shortcodes will try to display weather conditions for a current user on your website, based on his/hers location, which is furher based on an IP address of a user. Sometimes that Location can't be accessed because of a specific nature of the User's IP address and in that case the City name will default to London, UK.
2. How can i translate or rename the plugin labels?
You can use the Poedit software (http://poedit.net/wordpress) to translate/rename all of the plugin's labels. The required POT file is located in the plugin's languages folder.
3. Widget/Shortcode Layout is breaking in my Theme?
Please bare in mind that the Widget/Shortcode layout was tested in multiple Theme's and Widget Areas, including the default WordPress Theme. Nevertheless, issues with the layout may occur, because of the specific styling of different Themes. If that happens, please contact our support and we will be glad to help as much as we can.
For any further issues feel free to contact us on support@despotic-studio.com