Frontend style

This is my first Wordpress plugin. It displays a weather widget using the unofficial Google weather API.

Features

  • show today’s weather
  • show weather forecast for next 3 days
  • specifiy output language
  • choose between Celsius or Fahrenheit
  • comes with predefined CSS style
  • valid XHTML output

Example

You can see a working example down right in my sidebar.

Requirements

You need at least Wordpress version 2.8 or higher and a theme which allows widgets.

Download

For more information have a look at the plugin page or directly go to plugin page at wordpress.org.



83 Comments on “Wordpress plugin WP Google Weather Widget released – Feedback please”

You can track this conversation through its atom feed.

  1. Dietmar sagt:

    Bug-Report:

    Description: Include not found in wp-google-weather.php line 11

    /*
    * require_once(‘wp-includes/formatting.php’);
    */

    Solution:

    require_once(ABSPATH . WPINC . ‘/formatting.php’);

    1. Hendrik Will sagt:

      Thanks Dietmar! Weird, I didn’t get this error on my installations.

  2. Wordpress plugin WP Google Weather Widget released – Feedback … – Wordpress Plugins sagt:

    [...] here: Wordpress plugin WP Google Weather Widget released – Feedback … | More Categories: Wordpress Plugin Tags: a-weather-widget – api – delete-and – [...]

  3. Mike sagt:

    Hi Hendrik,

    Everything looks great, except whatever measure I choose for the temperature, it always shows Fahrenheit for the 3-day forecast (today’s temperature is as desired). I’m using Arclite theme, don’t think I’m doing anything wrong…!
    Thanks,
    Mike

    Update: I fixed the bug. Please, grab version 0.2 at http://wordpress.org/extend/plugins/wp-google-weather/ or use the auto upgrade.

  4. kilroy sagt:

    How can I add this widget directly into blog post? I need to create a list of weather for multiple areas all in one post.

    Thank you for taking the time to create.

    1. Hendrik Will sagt:

      Right now it just works as a widget. I might add this feature to one of the next versions.

  5. Tim sagt:

    Nice job!
    Congrats on your first WP-Plugin!
    I’ll check it out after building my house today :-D

  6. Danny sagt:

    Hi There,

    when installing this widget/plugin (thanks by the way!) it seems to be working, however the layout is nothing like your screen shot? Is it something on my side?

    Please advise.

    Danny

    1. Hendrik Will sagt:

      Please, check if my additional css gets loaded in your header.

  7. Colin sagt:

    Hi great plugin. It works well on my site BUT is there a list of the cities that can be used anywhere? The reason I ask this is that the forecast in the plug-in is very different to that on the Spanish Met Office website.

  8. Colin sagt:

    PS I should also have asked is it possible to get a 5 day rather than 3 day forecast?

    1. Hendrik Will sagt:

      I don’t think there is any list of available cities. 5 day forecast is not possibil with google weather api so far.

  9. Ron Agatep sagt:

    Hi. I installed your weather widget. Drag the widget to the right side. Did not cahnge anaything like title and city. But it does not work. Only showing is the title. What am I doing wrong. Please help. Thanks.

    1. Hendrik Will sagt:

      Right now it only supports CURL to fetch the xml data. Probably CURL is not installed on your webserver?

  10. Joe sagt:

    I am having the same problem as “Danny” was with this widget: There is no layout formatting when displayed on my page.
    You advised to: “Please, check if my additional css gets loaded in your header.” What does that mean? How can I fix this?

    Thanks for you help in advance! :)

    -Joe

    1. Hendrik Will sagt:

      Thank for the error report. I just updated the plugin and added a extra div wrapper to fix the layout problems with some templates.
      You can get a new version a the Wordpress plugin page or just use the auto updater of Wordpress.

  11. James sagt:

    Hi There – great idea for a widget :-)

    Unfortunately I’m getting a rather strange error which happened with 0.2 and is still happening with 0.3. I’ve tried this with my custom theme and WP default theme and the same thing happens.

    There’s a PHP error which means the widget doesn’t display, and it screws with the layout of the page.

    Here’s the error I get:

    Fatal error: Call to undefined function: simplexml_load_string() in /site/wp-content/plugins/wp-google-weather/wp-google-weather.php on line 164

    Any help in fixing this would be greatly appreciated!

    Keep up the good work!

    1. Hendrik Will sagt:

      This error means that you don’t have installed the simplexml php extension.

      Create a phpinfo file and have a look for the string ’simplexml’. If it won’t appear somewhere on page page you should contact your webhost and ask for simplexml php extension.

  12. will sagt:

    hi..is it possible to have maybe the country weather ie i need weather map of all of United kingdom..is this possible?

    1. Hendrik Will sagt:

      No, this isn’t possible. This would be a special application.

  13. Ron Agatep sagt:

    Hi Hendrik,

    I cannot get your widget to work on my website. I followed the instruction and I get only the title when I activate and enable the widget to sidebar 1. I have WP v2.8.3. Any ideas?

    Thank you in advance for your assitance.

  14. Thomas sagt:

    Plugin works great, but please consider some kind of caching for the weather data.

    1. Hendrik Will sagt:

      @ron please be sure to use php5 and the simplexml php module

      @thomas thanks, it’s already planned since v0.1 but I didn’t have time to implement it yet ;-) I’m using wp super cache a lot for general wp caching.

  15. idntt sagt:

    Plugin works fine on WP v 2.8.3. Thanks for sharing. Only problem I have is that weather widget is aligned to the left on the sidebar, I will like to have it centered. Any tips?

  16. Monchu sagt:

    Hi Hendrick,
    First of all, congratulation for this nice and useful widget.
    I would have 2 suggestions :
    - The french description of the weather conditions takes sometimes 2 lines (for instance : “Couverture nuageuse partielle”) and the second line mixes with the temperature below : would it be possible to adjust the height first blue field to the number of lines ?
    - We are a sailors group, and we are very much interested in wind speed and direction (as shoxn in Google Mete) ?
    THanks again and regards,
    Emmanuel (F-Lyon)

    1. Aymeric sagt:

      Hi Emmanuel,

      You can change the height of by editing wp-google-weather.css:

      Line 22 change to “height: 80px”
      Line 32 change to “height: 44px”

      And you can also reduce the font size at line 31

      Hope this helps
      Aymeric

  17. Frank sagt:

    Hi,

    Hello aus Kanada!

    Danke for the great widget!

    One minor request.. can you add support for click on the widget and go to the full weather report?

    Thanks

    Frank

  18. Kerry Webster sagt:

    Is there a way to make this work without using as a widget. I would like to place the code directly in a theme without having to require the user to activate the widget.

    Thanks. Awesome plugin.

  19. Mike sagt:

    By far the best visual looking wordpress weather plugin.

    Suggestion: Make it so the output auto re-sizes based on the sidebar width, ie 150, 300 and so on.

  20. alan telford sagt:

    Hi Hendrick,

    great widget, two comments however
    1) The image for today’s weather (next to today’s temperature) seems to giving an invalid image reference (just http://www.google.com)
    2) it would be nicer if it was centered in the column

    thanks again

    Alan
    (wp 2.8.4 ) using the latest version of your widget (0.3)

  21. alan telford sagt:

    Hendrick,

    the missing graphic has turned up now, so don’t worry about that. Don’t know why it wasn’t there before.

    regards

    Alan

  22. lisa sagt:

    this looks to be a great plugin, but i’m having problems activating it. when i do, i get this error:

    Plugin could not be activated because it triggered a fatal error.

    Fatal error: Class ‘WP_Widget’ not found in D:\Inetpub\wwwroot\resweb\wp-content\plugins\wp-google-weather\wp-google-weather.php on line 41

    any help is much appreciated.

  23. Webbie sagt:

    I got the plugin working, but how can I center it on my plugin, take a look at http://www.vvor4.nl.

    Tnx in advance!

  24. Studio5150 sagt:

    Nice plugin, but can I display this plug-in without sidebar? thx

  25. Hendrik Will sagt:

    @idntt, Webbie: edit your css

    @Monchu, Frank:thanks, I will add this to my to-do list

    @Kerry Webster, Studio5150: this is planned for an upcoming release

    @lisa: you need at least WP v2.8

  26. Cameron sagt:

    Hi, I have tried to use the plugin on a couple of sites.
    I seems to have 2 issues.

    1st. The weather description for today is not displaying and the weather image for today is not showing.

    2nd , on another 2 sites, todays weather image displays below todays temp rather than beside it.

    The 2nd problem is minor, but we need to get the 1st issue resolved.

    Wordpress version is 2.8.4
    other wise great.

  27. Lou sagt:

    Hi Hendrik :)

    Big thanks for the plugin!

    Question:
    The top blue bar doesn’t display the white text
    and beside todays’ temperature, there’s an icon missing.

    Otherwise all else displays and works fine.

    Would you be able to suggest what I need to adjust, please?

    Thank you…Lou

  28. Wayne sagt:

    I’m getting this error:

    Fatal error: Call to undefined function: simplexml_load_string() in /home/ilderton/public_html/fireblog/wp-content/plugins/wp-google-weather/wp-google-weather.php on line 164

    Any thoughts??

  29. MicK sagt:

    Hi, I am to having the icon and top current condition go missing. They are there when first install the last something like 15-20 minutes before vanishing, any ideas?

  30. Vicky sagt:

    This widget is lovely. Is there a function I can call so that I can use it in a template instead of a widget?

  31. Ray sagt:

    Hi Hendrik,

    Just installed your Wordpress Weather Plugin and it works great.

    Many thanks for your great work!

    Regards,

    Ray

  32. Henri sagt:

    Hello, I just found your weather thing and it looks great.
    But , and I am not a programmaer, can I only put the centigrade option instead of both?
    And how can I do that.
    Thank you in advance

  33. Carolinestar sagt:

    Hi there, love this plugin. Works very well. I have one question: How do I get the Icon to appear for Today’s Weather beside the Temperature. All other 3 icons appear no problem for the forecast. Does anyone know how to fix this?
    Many thanks
    Carolinestar

  34. Franz Frühwirth sagt:

    @Ron Agatep
    If your Provider doesn’t support curl lib (fatal error using function curl_init …) you can use this Code.

    $output = file_get_contents($xmlUrl);

    instead of:

    // create a new cURL resource
    $ch = curl_init();
    // set URL and other appropriate options
    curl_setopt($ch, CURLOPT_URL, $xmlUrl);
    curl_getinfo($ch);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

    // grab URL and pass it to the browser
    $output = curl_exec($ch);

    // close cURL resource, and free up system resources
    curl_close($ch);

    not so sophisticated but it works ;)
    @Hendrik gratz 4 your this fine PlugIn. It works very fine with WP 2.8.6 (with the little change)

  35. Brian sagt:

    Fatal error: Call to undefined function: simplexml_load_string() in /home/budgetbounce/budgetbouncehouse.com/wp-content/plugins/wp-google-weather/wp-google-weather.php on line 164

    Any solutions/ideas??

  36. Maria sagt:

    I’d like something like this that I can add to specific pages on my blog with a different city on each page. I know I can use Exec-PHP to get the code to work on the page; I just need the customizable code to insert. Please add this in a future version. Your format is exactly what I’m looking for: clean and compact.

  37. Alex sagt:

    hi – thanks for the plugin, it looks great

    What would i need to alter in the CSS to move the whole display to centre aligned? i’ve played around with the settings but cannot get the entire plugin to change from left aligned to centre aligned

  38. Evie Stewart sagt:

    LOVE this plugin, it’s beautiful, so so perfect for my blog, but I was told to deactivate it from my sidebar cause it was slowing the load.

    SO I’d LOVE to put it on my BEST OF L.A. page content (so it only loads when that page is seen, not on the home/index sidebar) —

    I know Kerry and some others have asked for what I need — but until you get a chance to make that new version, can you give us a workaround? Code to pop into the content? Anything? I can do it (and have techie pals) so I won’t bug you for a bunch of support… pretty-please?

    Thanks, if it were up you’d see how perfectly it goes with my site — yay (IF I can use it in a page…)

    @EvieStewart

  39. Ray sagt:

    Hi Hendrik,

    I have the same problem as a number of other users of your great plugin.

    Sometimes the ‘current’ condition wording and image display but most of the time they do not.

    The forecast for the other 3 days works perfectly.

    Would you please advise how this can be fixed as it makes the plugin virtually unusable for me?

    Many thanks in advance.

    Regards,

    Ray

  40. Ovidiu sagt:

    Wonderful plugin! I was looking for something like this, based on that simple API from Google, for months now.

    Thank you very much!

  41. Hendrik Will sagt:

    Thanks a lot for all feedback!

    I’ll try to update during the next weeks.

  42. Marty sagt:

    I’d also really like to see template tags. I rarely use widgets, as I develop my own custom themes from scratch. Best looking weather plug though.

  43. Andy T sagt:

    Hendrick

    Great plugin!! Nice and clean.

    It would be nice if a guest could put in their own location and get the weather for their area.

    The reason I would like this is that I’m doing a site on lawn care and for this a lot of the advice revolves around the weather.

    Any thoughts?

    Regards, Andy T

  44. tia sagt:

    Without thinking, I upgraded to latest wp 2.9.2 the plugin is no longer working in 2,9.2 Any plans to update? Love the plugin and would love to see it working on latest wp.
    Many Thanks

  45. Seb sagt:

    Hello Hendrick,

    Thanks for making this great plugin available.

    I’ve found that when I add the short code for it to a page or post, the weather box always appears at the top of the content area – no matter where I place it in the body.

    It’s not a css issue. The html is always generated directly after the post’s title. Any clues?

    Thanks

    1. jarem sagt:

      Maybe in this case (shortcode) is problem in buildWidget function (using echo instead return)

  46. David sagt:

    Hi, great plugin – thank you. We’d like to change the layout so that the next 3 days weather (which is currently under ‘today’s weather’) displays beside. Total width of 300 px. If you could help or have any advice would be much appreciated.

    Our site is not yet published but if you need to look I can send you a login/password. Please email me.

    Thanks for any help!

    Kind regards,

    David

  47. Mike sagt:

    Could you make this a 5 day forcast widget…that would be perfect. And may be a way to choose static, 3-day, or 5-day??? Thanks.

  48. Andrew sagt:

    Hi there,

    Im kind of disapointed the Sudbury Ontario Canada is not part of the possible options for the weather gadget. Any ideas on how to add it?

  49. Nico sagt:

    Hi, great plugin, thanks!

    I’ve found that, to make the shortcode to work, I have had to capture the widget class output and return it in the shortcode function, as follows:


    function hw_wp_gw_shortcode($atts, $content = null) {
    extract(shortcode_atts(array(
    "city" => 'Braunschweig, Germany',
    "temperature" => 'c',
    "language" => 'en',
    "forecast" => 'true'
    ), $atts)
    );
    $hw_wpgw = new hw_wpgw();

    ob_start();
    $hw_wpgw->buildWidget($city, $temperature, $language, $forecast);
    $output = ob_get_contents();
    ob_end_clean();

    return $output;
    }

  50. etomyam sagt:

    nice plugin..going to try this…hope it won’t consume much of my 32mb WP memory

  51. Adley sagt:

    Hi, great plugin but I also get the weather box always appearing at the top of the content area, even if it is the last element in the post.

    Thanks.

  52. Ronny sagt:

    Hi, I love this plugin. I works fine while searching common Cities, but i will travel to “Beersheba, Israel” and the plugin doesn’t show the current day correct. The forecast havn’t this problem… Did you maybe have an idea?

    Thx and kind regards
    Ronny

  53. PIP sagt:

    I would love to see av predefined CSS that made it possible to define the with.

  54. Jamie sagt:

    Hi,

    This widget worked great for me until I upgraded Wordpress to 2.9.2. I look forward to using it again when you make it compatible with the new Wordpress update. Thanks!

  55. Marcus sagt:

    It’s indeed a great plugin, shame it does not support portuguese language, neither pt nor br codes seem to work, how could I possibly get this amazing tool to work in Portuguese? I’m more than able to help translate the plugin to run on portuguese language. Any help on how I can get access to the archives that have the core words which must be translated? Thanks in advance!

  56. Rocky sagt:

    Hi Hendrik, Thank you very much for your great contributions on this useful plugin. I hope you will make an update for this small tool in short future.
    And I bet it will be even popular than now.
    Features I wish to have:
    ×Color shows Half transparent. not the solid color now, will be more confort, like those colors used in iphone ect.
    *the dimension will be adjustable to fit for different side bar width(Give a scope to adjust or give a min. and max to follow.)(My side bar width is 250px and there’s big blank left, I don’t know how to adjust in the codes.)

    That’s what I really want to have now for this weather tool.

    Still grateful for your good work.

    Wish you more successful and made out more plugin tools.

    Big hug!
    Rocky W

  57. sharyn sagt:

    thank you Hedrik! just successfully added my first wp plugin. i LOVE wp.google.weather. however, it disrupts the look of my home page unless i place it as the very last (lowest) sidebar item. i would like it to be my second sidebar item (after my seach box but before my ‘categories’) you know, to add some color near the top of my homepage. but, when i place it there, my remaining sidebar items (pages, links, archives) get shoved way, way down to the bottom of the page. it is as though the weather box is using many, many inches of white space below it. otherwise, it works perfectly. is there a simple fix? i’m a total newbie to wp. i use wp 2.92 and downloaded your plugin v 0.4.

  58. sharyn sagt:

    hedrik, i meant to say i’m using wp’s default version. you can look at my site at http://www.lewiscountysirens.com thank you for creating a simple to use plugin!

  59. Avner Kaplan sagt:

    Hi
    your plugin is great and working well as long as it en but when i change the Lang to he (Hebrew) i see gibberish.
    for some reason the char set is not utf-8 but getting some other char set
    can you help me with it?
    best regards
    Avner

  60. sharyn sagt:

    hey hedrik, i got it fixed with help on wp support forum. thanks again for an awesome plugin. –s

  61. stan sagt:

    awesome plugin thank you thank you! i needed one without any sort of link and this worked flawlessly on wordpress 2.9.2

    thanks again! (you should have a donate button)

  62. Christian sagt:

    The plugin works really great untill today, i looked at my blog and its all over this error from the widget:

    Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 9: parser error : AttValue: ” or ‘ expected in /homepages/11/d156005184/htdocs/blog/wp-content/plugins/wp-google-weather/wp-google-weather.php on line 154

    Any idea how to solve this?

  63. Randall Hardy sagt:

    Hi,

    Very useful plug in, much appreciated.

    I keep getting asked why the dates are ‘wrong’ on the 3 day forecast :{

    Is there any way I could add the text “Min/Max Temps” below the graphics?

    Thanks.

  64. Simon sagt:

    Hendrik, a very quick bug fix if you can… I am missing the icon for todays weather on this widget, I have logged onto the wp fourms to no avail, all the forecast icons are there, just not todays – any ideas?

    http://www.st-bo.co.uk/?page_id=52

    Bottom of the sidebar

    Many thanks

    Simon

  65. Rillmeister sagt:

    Hi, great plugin!

    But what does the numbers on the 3-day forecast stands for?

    25/15 I know that the first stands for celsius degrees, but the other one(15)?

    Regards,

  66. Craig sagt:

    Hi Hendrik,

    Wondering if you or anyone else could help me.

    I love your weather widget… i’m just trying to add a little code to make it centre on my sidebar instead of justifying left.

    Do you have any ideas on how i can do this?

  67. Igby sagt:

    hello hendrik,

    i’m sure i would love your plug-in, if there weren’t the fatal error :(

    Fatal error: Call to undefined function: simplexml_load_string() in /www/…/wp-content/plugins/wp-google-weather/wp-google-weather.php on line 154

    can you help me?

    liebe grüße aus süddeutschland :) )

  68. flo sagt:

    hi, great plugin. i would love to use my own icons. is that possible? if yes, how? :) thanks for your help

  69. Steven sagt:

    Hi there,

    Is there php short code to insert this wp-google-weather plugin into my wordpress template (so not a widget or post or page. In my case I want to insert it into the header new to the logo.

    I look forward to your reply

  70. beth sagt:

    I am getting error on my front page:
    Fatal error: Call to undefined function: simplexml_load_string() in /disk1/usr16/nuke/www/3percentofaton/wp-content/plugins/wp-google-weather/wp-google-weather.php on line 154

    Can you help”
    Thanks
    Beth

  71. Mani sagt:

    Hello Hendrik,

    This wp plugin is just great, how ever, just like a few others that have comented, is there a way I can have the plugin appear to be on the right side of my side bar instead of the defauly left?

    I am using it for a site which is RTL, and it just looks out of line when its the only thing thats on the left side.

    Please let me know.

    Thanks a lot

    Keep up the good work

    Mani

  72. Eivind sagt:

    Hi there.
    I’m using your weather plugin. It did work for a long time, but now it shows an enormously big temperature (like 43 c, when it’s only 26) on my website.
    Click on my website (in Norwegian, though) and have a look. Kinda crazy, but I like your plugin and don’t wanna remove it, you see.
    Take care, man!

Einen Kommentar hinterlassen

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>