• Resolved DBZEROONE

    (@dbzeroone)


    This is a great plugin! My wind speeds are returning as m/s. Is there a shortcode attribute to convert that to mph? I am not using the widget, but instead using the shortcode in my theme. Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter DBZEROONE

    (@dbzeroone)

    This bug is showing the correct number, but the wrong units. Hopefully the developer will fix this in the next release, but until then if anyone else is having trouble with this bug, add the following code to your functions.php file. This will replace m/s with mph.

    // CHANGE OUTPUT OF WIND SPEED UNITS FROM m/s TO mph //
    
    function dbz_awesome_weather_wind_speed_text()
    {
      return $wind_speed_text[] = "mph";
    }
    add_filter('awesome_weather_wind_speed_text', 'dbz_awesome_weather_wind_speed_text');

    Hello, so how would you do the same to display kph in the widget? I think the number is correct there showing m/s, to display kph we would need to multiply the number with 3.6 as well and then change the “m/s” text to “kph” as well.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change m/s to mph using shortcodes’ is closed to new replies.