Support » Plugin: wp-forecast » [Plugin: wp-forecast] change weather location for each page

  • Resolved arpitap



    I am developing hotel brand website and in that they have different hotels in different locations.
    So what I want to do is when people open one hotel it should display weather for that location and when people open other hotel it will display weather for that location.

    In short I want to display different location weather in each page.

    Can anyone suggest me some way for that? I am PHP guy, so I can make changes in code also if it is required.

    Any help would be appreciated.

    Thanks in advance,

Viewing 5 replies - 1 through 5 (of 5 total)
  • I have given some condition in func_accu.php, but it is not taking that conditioning unless I update the backend for wp-forecast.

    Plugin Author tuxlog


    Well, I can think about two ways of achieving this. first is to create a selection widget with all locations you want and add a bit javascript to set the correct location for your page. the second and easier variant is to add a bit of php to your sidebar.php where you get the pagename and switch to the correct widget.

    switch($pagename) {
    case ‘page1′: $wid=’A’;break;
    case ‘page2′ : $wid=’B’;break;


    Thanks tuxlog,

    the problem is that I need to use more than 20 widgets because we have more than 20 hotels in one brand.


    Plugin Author tuxlog


    you can raise the number of available widget in wp-forecast.php changing $wpf_maxwidgets (somewhere at the top of the file) to the number you need.
    but please keep in mind that this may lead to a sometimes high server load. but you can control this setting the cache time higher and lower the timeout for the connections. it may be that you have to test various settings until you finde the best for your environment. please also have a look at the license from accuweather or weatherbug to make sure you are in line with those.

    regards, hans

    Thanks Hans for your help.

    I will try that and let you know if it helped.


Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: wp-forecast] change weather location for each page’ is closed to new replies.