Use directory current location?
-
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?
- The topic ‘Use directory current location?’ is closed to new replies.