Title: PHP code to include plugin Awesome Weather Widget
Last modified: August 21, 2016

---

# PHP code to include plugin Awesome Weather Widget

 *  [ePilipovic](https://wordpress.org/support/users/epilipovic/)
 * (@epilipovic)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/php-code-to-include-plugin-awesome-weather-widget/)
 * Hello,
 * is it possible to include this plugin via php code, something like this?
 * `<?php if(function_exists(wp_aweather)) { wp_aweather( <widget_id> ); } ?>`
 * how should it look for awsome weather widget?
 * [http://wordpress.org/plugins/awesome-weather/](http://wordpress.org/plugins/awesome-weather/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Hal Gatewood](https://wordpress.org/support/users/halgatewood/)
 * (@halgatewood)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/php-code-to-include-plugin-awesome-weather-widget/#post-4217088)
 * You can use the do_shortcode function:
 * `<?php echo do_shortcode('[awesome-weather location="Montreal" units="F" size
   ="tall" override_title="MTL" forecast_days="2" hide_stats=1 background="http://
   urltoanimage.jpg" custom_bg_color="#cccccc" inline_style="width: 200px; margin:
   20px; float: left;"]'); ?>`
 *  [urlatore](https://wordpress.org/support/users/urlatore/)
 * (@urlatore)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/php-code-to-include-plugin-awesome-weather-widget/#post-4217089)
 * Hi, you can add condition to php?
    like: $_SESSION[‘post_city_id’]==’4′
 * thanks
 *  Plugin Author [Hal Gatewood](https://wordpress.org/support/users/halgatewood/)
 * (@halgatewood)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/php-code-to-include-plugin-awesome-weather-widget/#post-4217090)
 * Maybe you mean something like this?
 * `<?php echo do_shortcode('[awesome-weather location="' . $_SESSION['post_city_id'].'"
   units="F" size="tall" override_title="MTL" forecast_days="2" hide_stats=1 background
   ="http://urltoanimage.jpg" custom_bg_color="#cccccc" inline_style="width: 200px;
   margin: 20px; float: left;"]'); ?>`

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘PHP code to include plugin Awesome Weather Widget’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/awesome-weather_ad7c7d.svg)
 * [Awesome Weather Widget](https://wordpress.org/plugins/awesome-weather/)
 * [Support Threads](https://wordpress.org/support/plugin/awesome-weather/)
 * [Active Topics](https://wordpress.org/support/plugin/awesome-weather/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/awesome-weather/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/awesome-weather/reviews/)

## Tags

 * [awsome](https://wordpress.org/support/topic-tag/awsome/)
 * [weather](https://wordpress.org/support/topic-tag/weather/)

 * 3 replies
 * 3 participants
 * Last reply from: [Hal Gatewood](https://wordpress.org/support/users/halgatewood/)
 * Last activity: [12 years, 6 months ago](https://wordpress.org/support/topic/php-code-to-include-plugin-awesome-weather-widget/#post-4217090)
 * Status: not resolved