• Resolved kdardis

    (@kdardis)


    It shows the temperature in Celsius even though I have Fahrenheit selected in the widget. Can someone please help??

Viewing 2 replies - 1 through 2 (of 2 total)
  • To fix this:

    Find this code in index.php of the plugin:

    		echo $args['before_widget'];
    			echo $args['before_title'];
    				echo $settings['m1mw_widget_title'];
    			echo $args['after_title'];
    			if ($m1mw_data->error ===false) {
    				echo '<div class="wi wi-owm-' . $m1mw_data->weather[0]->id .'" title="' . $m1mw_data->weather[0]->description . '" style="font-size: 2em;' . $m1mw_fontColor . '">
    			       <span class="m1mw_temp">' . $m1mw_data->tempC . '&deg;</span>

    Replace with:

    
    		if ($settings['m1mw_value'] == 'C') {
    			$m1mw_data->temp = $m1mw_data->tempC;
    		}
    		else {
    			$m1mw_data->temp = $m1mw_data->tempF;
    		}
    		
    		echo $args['before_widget'];
    			echo $args['before_title'];
    				echo $settings['m1mw_widget_title'];
    			echo $args['after_title'];
    			if ($m1mw_data->error ===false) {
    				echo '<div class="wi wi-owm-' . $m1mw_data->weather[0]->id .'" title="' . $m1mw_data->weather[0]->description . '" style="font-size: 2em;' . $m1mw_fontColor . '">
    			       <span class="m1mw_temp">' . $m1mw_data->temp . '&deg;</span>
    

    You can find the index file in /wp-content/plugins/m1miniweather/

    Note: If you modify the plugin, it will be overwritten with newer versions. Hopefully the author can implement this code.

    • This reply was modified 7 years, 2 months ago by flome. Reason: Added full code snippet
    Plugin Author maennchen1.de

    (@maennchen1de)

    Hello!
    Sorry for the long abstinence.
    Update #0.3 will fix that issue.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Temperature uses Celsius, Not Fahrenheit’ is closed to new replies.