Forum Replies Created

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • in reply to: WP All Import to import Fields into GeoMyWP #55062

    Hi, I have insert this code in my functions.php:

    function gmw_update_post_type_post_location( $post_id ) {

    // Return if it’s a post revision
    if ( false !== wp_is_post_revision( $post_id ) )
    return;

    // check autosave //
    if ( defined( ‘DOING_AUTOSAVE’ ) && DOING_AUTOSAVE ) {
    return;
    }

    //check if user can edit post
    if ( !current_user_can( ‘edit_post’, $post_id ) )
    return;

    //get the address from the custom field “address”
    $address = get_post_meta( $post_id, ‘adresse-strasse’, true );

    //varify that address exists. Otherwise abort the function.
    if ( empty( $address ) )
    return;

    //include the update location file file
    include_once( GMW_PT_PATH .’/includes/gmw-pt-update-location.php’ );

    //make sure the file included and the function exists
    if ( !function_exists( ‘gmw_pt_update_location’ ) )
    return;

    //Create the array that will pass to the function
    $args = array(
    ‘post_id’ => $post_id, //Post Id of the post
    ‘address’ => $address // the address we pull from the custom field above
    );

    //run the udpate location function
    gmw_pt_update_location( $args );
    }
    //execute the function whenever post type is being updated
    add_action( ‘save_post_post’, ‘gmw_update_post_type_post_location’ );

    But it’s not working. Can you help me please? I use a custom post type called “kirchen”.

    Hope you can help me soon… 🙁

    in reply to: WP All Import to import Fields into GeoMyWP #55042

    Hi, thank you very much!

    Can you give me a example code for gmw_pt_update_location? I don’t know how I have to modificate this functions for my own.

    I have a created a custom field with “advanced custom fields”. It’s a single field for the “address”.

    In this field I insert a address like this:

    Lessingstrasse 8, 67454 Hassloch, Germany

    This custom field (ACF) can I insert in my template with this code:

    <?php the_field(‘acf-address’);?>

    Now, can you give me the functions, so I can save this custom field to geomywp database table?

    Thanks a lot,
    Pascal

    PS: Sorry I don’t know how to use this function “gmw_pt_update_location”

    in reply to: WP All Import to import Fields into GeoMyWP #55010

    Here is another screenshot from the import plugin. Here I can set special meta fields for import. But I don’t know the meta fields for geo my wordpress. Where can I find this fields (names)?

    And I can insert a function for import. I want to set the values from my CSV-File into geo my wordpress.

    And my ACF fields are:

    – acf_street (ex. Musterstrasse)
    – acf_zipcode (ex. 12345)
    – acf_location (ex. Musterhausen)

    Hope you can help me 🙂

    Attachments:
    You must be logged in to view attached files.
    in reply to: WP All Import to import Fields into GeoMyWP #55008

    Hi,

    I have created a custom post type “kirchen” and included the geo my wordpress plugin for this post type. Now I have created custom fields with the “advanced custom fields” plugin (ACF).

    I’m using the plugin “WP All Import” to create new posts. I have created a .csv-file with some values to create new posts.

    Now I want to import the .csv-file and want to created some new posts.

    With the plugin “WP All Import” I can import the values from my .csv-file as values for ACF (look at the screenshot as attachment).

    All the posts created new after import. Is it possible to create a new post, set values to custom fields (ACF) and after saving, the values from ACF connected with geo my wordpress… also use the values from ACF for geo my wordpress.

    Or where can I find the custom fields meta for the fields from geo my wordpress like street, location, zipcode, etc.

    Attachments:
    You must be logged in to view attached files.
    in reply to: WP All Import to import Fields into GeoMyWP #54984

    Hi, thanks a lot. I will test it 🙂

    in reply to: WP All Import to import Fields into GeoMyWP #54972

    Hi Eyal,
    thanks for your feedback 🙂

    I have custom fields integrated with advanced custom fields:

    – Street
    – Zipcode
    – Address
    – etc.

    Is it possible to use this values from this fields to integrate it into geo my wordpress?

    Is there any code example for it? I have seen that I can updated geo my wordpress values. But I don’t know how it works… can you help me?

    Thanks,
    Pascal

    in reply to: Display results on search page #51869

    Ok, sorry! The problem was a setting 🙂 Now it works! Thanks a lot! 🙂

    in reply to: Display results on search page #51858

    Hi Eyal,

    sorry it isn’t working. I have created a new form as you say and insert the shortcode in my search results page, but is isn’t working… hope you can help me…

    Thanks,
    Pascal

    in reply to: Change the distance slug in search results #51685

    How can I change from miles into kilometers in this function:

    <?php gmw_distance_to_location( $post, $gmw ); ?>

Viewing 9 posts - 1 through 9 (of 9 total)