- This topic has 10 replies, 2 voices, and was last updated 3 years, 6 months ago by
Eyal Fitoussi.
-
AuthorPosts
-
July 30, 2017 at 12:04 am #56189
winetrade
MemberHi,
i notice that on the IOS WordPress App that we can use to publish blog posts there is an option called “post location”.
Is compatible with geo mywp?Mean, if i have a website with your plugin and from the mobile app i add the post location, i can see the article on the Geomywp map?
If no, there somenthing we can do to let people writing articles with geo location from their smartphone or tablet?
Thanks
July 30, 2017 at 1:17 am #56191winetrade
MemberAn update. i read that plugin is not compatible with wordpress geo data but i found this: https://wordpress.org/support/topic/get-post-location-from-custom-fields/
that can help.My question is:
Is possible to change the function explained in the post above to automaticly update geomywp location informations by getting them from wordpress geodata core?I want that when people send an article from the WordPress Ios App adding the location, the post show on the geomywp map and can be searchable.
August 5, 2017 at 9:44 pm #56211Eyal Fitoussi
MemberHello winetrade,
You should be able to modify the function mentioned here to work for your needs. In the example mentioned in the tutorial the plugin will grad the address from a specific custom fields and update GEO my WP based on that.You need to find out where the “post location” of the app that you are using is being saved. I believe that it is being saved in custom fields as well. And if that is the case you only need to modify the example function based on the custom fields of your app. Otherwise, if the “post location” is saved in custom location, such as custom database table, you need to modify the function in the example to grab the data from the custom database and then pass it into the function that updates the data in GEO my WP database.
Let me know if this helps.
August 6, 2017 at 8:41 pm #56217winetrade
MemberThank you, the fields are the standard wordpress field. MEan that i use the ios wordpress app to add the post and in that app i can see the geolocation fields.
If i check then the post on desktop i can see the two custom fields.
I’ll try as you suggest. Thank youDecember 8, 2018 at 12:57 am #58349winetrade
MemberHi, i reopen the topic for a question.
I followed the tutorial but i notice that in the functions i have in the array the field “address”, “city” …
I need to use “latitude” and “longitude”.
What are the labels i can use to import these values from WP Geocode to GEOMYWP location fileds?
ThanksDecember 10, 2018 at 10:01 am #58355winetrade
MemberAn update, i need to “read” values from the fields showed in “FROM” and UPDATE GeoMyWP fields “TO” everytime i save or update an article.
I can reverse geocode to get address and update a “location” field for GeoMyWP but i don’t know where i need to put functions.I followed this: http://docs.tempform.wpengine.com/gmw_update_post_location-function/
but nothing happensThanks
Attachments:
You must be logged in to view attached files.December 10, 2018 at 1:56 pm #58359Eyal Fitoussi
MemberHello @winetrade,
First thing you need to do is to update to GEO my WP v3.2 beta 2 which you can download from here.
On that same page you can read why the geocoder function does not work on GEO my WP 3.1 or later.
You will also need to create an additional Google Maps Server API key, enter it in the settings page of GEO my WP and test it. This is all described in the page linked above.
When you are done updating to v3.2 and adding a server API key, see this page for details about the function that you need to use.
To use coordinates with the function you need to pass an array of ‘lat’ and ‘lng’.
1234$location = array('lat' => 'latitude goes here','lng' => 'longitude goes here',);I hope this helps.
December 10, 2018 at 9:29 pm #58360winetrade
MemberThanks, i start to follow your instruction and update you soon.
Thank youDecember 11, 2018 at 2:05 am #58361winetrade
MemberYou mean i need to do somenthing like this:
$location = array(
‘lat’ => ‘26.754347’,
‘lng’ => ‘81.001640’,
);
gmw_update_post_location( $post_id, $location );After this test, then i need to “read” lat & lng from my custom fields right?
December 11, 2018 at 3:04 am #58362winetrade
MemberTHAT’S WORK!
I don’t know if you want to share this in a tutorial but with this TRICK on your function you will be able to do this:1) Use the WORDPRESS Ios or Android app to post on your website
2) Add your location to the post from the APP
3) The function get Lat & Lng from the post and put them into GeoMyWp fields correctly to display them on the map.$lat= get_post_meta( $post_id, ‘geo_latitude’, true ); //latitude
$lng= get_post_meta( $post_id, ‘geo_longitude’, true ); //longitude
//run the udpate location function
$location = array(
‘lat’ => $lat,
‘lng’ => $lng,
);
gmw_update_post_location( $post_id, $location );
}YES!
December 13, 2018 at 3:25 pm #58366Eyal Fitoussi
MemberPerfect! I am glad it is working.
Thank you for posting the details. I have made this post sticky as other users might find it useful.
-
AuthorPosts
The topic ‘WORDPRESS MOBILE APP AND LOCATION COMPATIBILITY’ is closed to new replies.