Skip to content

Instantly share code, notes, and snippets.

@halgatewood
Last active November 7, 2017 19:32
Show Gist options
  • Save halgatewood/006b0bebaa797de78069500a26f16927 to your computer and use it in GitHub Desktop.
Save halgatewood/006b0bebaa797de78069500a26f16927 to your computer and use it in GitHub Desktop.
How to show the simple weather in a PHP template for Awesome Weather Widget PRO
<?php
$where = new stdclass;
$where->location = "Dublin";
$where->owm_city_id = 2964574;
$where->units = "F";
$weather = get_awesome_weather_openweathermaps( $where );
if( isset($weather->data['current'])) { ?>
<div class="awe-weather">
<i class="<?php echo $weather->data['current']['icon']; ?>"></i>
<?php echo $weather->data['current']['temp']; ?>&deg; <?php echo $weather->data['current']['description']; ?>
</div>
<?php } ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment