Support » Plugin: Weather Underground » [Plugin: Weather Forecast – WP Wunderground] Passing Location Variable

  • Mark


    I love the look and feel of this plugin, but was hoping I could pass a variable to it. Is this possible? I’ve tried passing it with shortcode too but that didn’t work:

    <?php echo do_shortcode(‘[forecast location=”‘.the_resort_location_weather().'”]’); ?>

    Does anyone know how I could accomplish this?

    Thanks for the help!

Viewing 1 replies (of 1 total)
  • After about 4.5 hours of banging my head, I finally found out how to pass parameters to this plugin. Your bit of code up top helped me.

    I am pulling locations from a database, so my variables are obviously being defined prior to the call. The code is as follows:

    <?php echo do_shortcode('[forecast location="' . $city . ' , ' . $state . '" caption="' . $city . ' , ' . $state . '" numdays="3" iconset="Cartoon" class="css_table_class" cache="true"]'); ?>

    The syntax that kept tripping me up is the need to include spaces before and after the period where the variable is named. Notice right after the first equals sign above there is a double-quote, a single quote, a space, a period, another space, the variable name, a space, and a single quote. I had tried many times without the spaces, and I could not get it to work.

    Hope this helps.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Weather Forecast – WP Wunderground] Passing Location Variable’ is closed to new replies.