• Resolved santakrooz

    (@santakrooz)


    Hi, I’m trying to setup an Indeed RSS import with WP All Import WPJobManager Add-on plugin, and everything works well except the geocode location. The Indeed RSS field for location is a lat/long field rather than separate lat and long fields ie <georss_point>35.82348 -78.82556</georss_point> but the import plug in has separate lat and long fields, so having trouble configuring this import to correctly geocode the location. Is there a way to separate the lat and long from the single field? or another way to accomplish this? thanks in advance.
    -sk

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter santakrooz

    (@santakrooz)

    so I have found the custom functions feature and added these functions and am calling from the lat and long fields as [getlat({georss_point[1]})] and [getlong({georss_point[1]})] however while it is now separating the rss field into two, and returning the proper lat and long values into the fields the import is not geocodeing those values, or at least populating the results into the location field in the db. my google maps geocode api is being called successfully, I can see that from the google api dashboard, and in the wpallimport log, however the location fields for each job record remain populated with the lat and long values rather than the geocoded location. Any help appreciated, have everything working nicely so far except for geocoded locations on import. Thx -sk

    <?php
    function getlat ($mylatstring=null){
    $lat = substr($mylatstring,0,strpos($mylatstring," "));
    return (floatval($lat));
    }
    
    function getlong ($mylongstring=null){
    $long = substr($mylongstring,strpos($mylongstring," ")+1);
    return (floatval($long));
    }
    Plugin Author WP All Import

    (@wpallimport)

    Hi @santakrooz

    If you use the latitude/longitude to define the location in the import then that’s what will be used as the location even when the geocoding request is successful. If you want to use the formatted address found during the geocoding process, then you can add this snippet to your Function Editor:

    add_action( 'pmxi_saved_post', 'my_set_location', 10, 3 );
    
    function my_set_location( $post_id, $xml_data, $is_update ) {
    	$geocoded_address = get_post_meta( $post_id, 'geolocation_formatted_address', true );
    	if ( ! empty( $geocoded_address ) ) {
    		update_post_meta( $post_id, '_job_location', $geocoded_address );
    	}
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Indeed RSS Import w/geocoding’ is closed to new replies.