WordPress.org

Ready to get started?Download WordPress

Forums

Weather Forecast - WP Wunderground
How can I use it as a widget at the side bar - WP Wunde (5 posts)

  1. walduran
    Member
    Posted 2 years ago #

    WP Wunderground Weather Forecast - WP Wunderground How can I use it as a widget at the side bar

    http://wordpress.org/extend/plugins/wunderground/

  2. walduran
    Member
    Posted 2 years ago #

    an how can I show the weather now?

  3. indianabenny
    Member
    Posted 2 years ago #

    walduran,

    It's not a widget, but if you can edit your theme files and you can edit the plugin file, you can add a function to allow you to add it to your theme manually. First add the following code to the bottom of the wunderground.php file found in the wunderground plugin folder:

    function goWeather() {
    	$goWpUnderground = new wp_wunderground();
    	$goWeather = $goWpUnderground->build_forecast();
    	echo $goWeather;
    }

    After you've done that, go to your theme file and place the following where you want the weather to show up (the sidebar.php file for example):

    <?php
         if(function_exists('goWeather')) {
    	goWeather();
         }
    ?>
  4. Wish Web Geek
    Member
    Posted 2 years ago #

    I did this but I get this error showing up on my page:

    Warning: Missing argument 1 for wp_wunderground::build_forecast(), called in /home/vrflagst/public_html/wp-content/plugins/wunderground/wunderground.php on line 636 and defined in /home/vrflagst/public_html/wp-content/plugins/wunderground/wunderground.php on line 383

    http://vr.flagstaffit.com/guide-service/ - see sidebar

    It looks like it wants me to define build_forecast in the code you said to put into the wunderground.php file.

  5. aaviya
    Member
    Posted 1 year ago #

    Hi, I tried your solution, but it still doesn't show in sidebar. Can you help me to display weather as widget?

    10x

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic