Support » Plugin: Awesome Weather Widget » Use directory current location?

  • Resolved ckubs

    (@ckubs)



    I’m using GeoDirectory for my site and having the option to let my users to be geoilocated or chose their location, foud an advice of someone that tried to get GD location in Awesome Weather.

    “In awesome-weather.php after line 79”
    $available_locales = array( 'en', 'es', 'sp', 'fr', 'it', 'de', 'pt', 'ro', 'pl', 'ru', 'uk', 'ua', 'fi', 'nl', 'bg', 'sv', 'se', 'ca', 'tr', 'hr', 'zh', 'zh_tw', 'zh_cn' );
    add this

    $current_location = geodir_get_current_location(array('echo'=> false));
    
    	//add_action( 'geodir_after_listing_post_title', 'country_listing', 45 );
    	//function country_listing() {
    	global $post;
    	global $wp_query;
    
    	$postid = $wp_query->post->ID;
    	$postcity= geodir_get_post_meta($postid,'post_city',true);
    	$postregion= geodir_get_post_meta($postid,'post_region',true);
    	$postcountry= geodir_get_post_meta($postid,'post_country',true); 
    
    	//echo $postcountry." - ".$postregion." - ".$postcity;
    
    //}
    
    	$location = $current_location;
    		$location = $current_location.','.$postcountry;
    		//echo $location;

    I guess it works for him but, donno. Added that piece of code, although I’m not that positive about modifying plugin files. And I see the widget picking up the current GD location for some locations working, for some displaing nearby small locations and for some a blank widget.

    Is there a better and clean way to integrate this?

    https://wordpress.org/plugins/awesome-weather/

Viewing 6 replies - 1 through 6 (of 6 total)
  • No answer? I really like this plugin but I can’t use it though.

    Plugin Author Hal Gatewood

    (@halgatewood)

    My pro plugin has this functionality: https://halgatewood.com/downloads/awesome-weather-widget-pro

    So, if I buy the premium version I can integrate Aweesome Weather with Geodirectory? That Is what I wanted to know.

    Plugin Author Hal Gatewood

    (@halgatewood)

    No, the PRO version does not work with Geodirectory. It uses its own version of Geolocation. Not entirely sure how geodirectory works but if it can return something like this:

    $location = get_wpgeodirectory();
    echo awesome_weather_logic( array('location' => $location));

    Ok. Thank you.

    I’m running this on my geodirectory site. It’s good, apart from the fact that it only displays weather for the capital city of the country of the listing…

    In other words, if I have a listing in cambridge, England it will show me results for London…. if in France, it always displays Paris…

    I wish I could get it more specific… e.g if the listing is in Cambridge, England… the weather forcast is in Cambridge

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Use directory current location?’ is closed to new replies.