WordPress.org

Ready to get started?Download WordPress

Forums

wp-forecast
[resolved] Wind direction - style (13 posts)

  1. eldenroot
    Member
    Posted 5 months ago #

    1) Please could you tell me how to add wind direction next to the picture after the speed?

    you know now we have:

    picture of wind speed of wind and then I would like to show direction (N,W, NW, etc)

    2) I would like to add some space before the weather radar, or <hr> - where to add this? Thank you

    http://wordpress.org/plugins/wp-forecast/

  2. tuxlog
    Member
    Plugin Author

    Posted 5 months ago #

    you can change all this in wp-forecast-show.php around line 300

  3. eldenroot
    Member
    Posted 5 months ago #

    could you help me what to add to show wind direction? rest I can make it by myself...

    example:
    radar ........ speed of wind (2m/s), NW (wind direction)

  4. tuxlog
    Member
    Plugin Author

    Posted 5 months ago #

    try
    `$a=wp_forecast_data("A"); // gets the data for widget A in array $a
    print_r($a); // print out all data'
    you will get all available data fields

    You get the wind direction using $a['winddir']

  5. eldenroot
    Member
    Posted 5 months ago #

    OK, I am working on this... I hope it will be working :D

  6. eldenroot
    Member
    Posted 5 months ago #

    // show wind on the right side if windicon is active
    		if ($windicon == "1")
    			$out .= '<div class="wp-forecast-wind-right">' . $w['windspeed']$a
    
    ['winddir']."</div>\n";

    is is correct or am I missing something?

    EDIT: Ok, it is not working... I will look at this when I come home... if you could write me it it would be better

  7. tuxlog
    Member
    Plugin Author

    Posted 5 months ago #

    $out.=$w['winddir']."</div>\n";
    would be better

  8. eldenroot
    Member
    Posted 5 months ago #

    OK, it shows wind direction but it doubled the image in widget (double wind radar and icon of weather)... I am lost a little :D

  9. eldenroot
    Member
    Posted 5 months ago #

    OK, after 1 hour of cahnging code - no success... help is welcome, thanks :)

  10. tuxlog
    Member
    Plugin Author

    Posted 5 months ago #

    It would be great if you can give the code you have tried and what does not work. I think my code works. Do you know php?

  11. eldenroot
    Member
    Posted 5 months ago #

    I know php a little bit... it is not my daily work but I can make it.

    You code was OK, but it doubled my icons in widget... it would be better if you can post we a whole code or entire the line in code

    thank you or your help

  12. tuxlog
    Member
    Plugin Author

    Posted 5 months ago #

    Well, I think

    // show wind on the right side if windicon is active
    
    if ($windicon == "1")
    $out .= '<div class="wp-forecast-wind-right">' . $w['windspeed'] . " " . $w['winddir']."</div>\n";

    would be better I think.

    works?

  13. eldenroot
    Member
    Posted 5 months ago #

    Thank you very much - it is working, I just added "," between wind speed and winddirection ;)

    Thank you!

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.