Support

Account

Forum Replies Created

  • Hello, I found a new Plugin called “WordPress Awesome import export” which works with Advanced Custom Fields and is much cheaper than all other plugins! Very easy to use! http://codecanyon.net/item/wordpress-awesome-import-export-plugin/12896266

  • I found a new plugin which works great with “Advanced custom fields” and is much cheaper than all other plugins out there! Intuitive, easy to use.

    http://codecanyon.net/item/wordpress-awesome-import-export-plugin/12896266

  • I found a new Plugin which works with Advanced Custom Fields and is much cheaper than all other plugins! http://codecanyon.net/item/wordpress-awesome-import-export-plugin/12896266

  • perhaps in combination with another plugin, which is writing to the database, like this? https://wordpress.org/plugins/contact-form-7-to-database-extension/

  • but perhaps, when you have a plugin, which converts automaticly in the backend all stored acf-maps-coordinates into name, street, country, city, etc … and safe those into the database. then you could send some get_field request from your database, without calling all the time again and again on on-the-fly the geo-coding thing.

    does somebody want to code such a plugin? 🙂

  • change “locality” or “country” to the things you need, check out: https://developers.google.com/maps/documentation/geocoding/intro for variables

    but … when you have a lot of streets and cities … i think the website is slowing massive down. i implemented this into my website first, but then i took it out again, cause i think it is slowing the website down a lot (if you have a lot of geo requests…)

    perhaps another solution? or am i wrong?

  • I made here a shortcode to show the “city, country” from the coordinates

    You have to change the get_field(‘adresse’, $id) to your ACF field name.
    Here you need to write also the post id or you can just delete the beginning.
    I m not sure if you need a google api key … i tried it both with and without and it works…
    You can put that code in the functions.php of your theme

    It could be that you have to change on your server in the php.ini ( allow_url_fopen=0 ….. to …. allow_url_fopen=1 )… when you get an error like this “http:// wrapper is disabled in the server configuration by allow_url_fopen=0” …

    I m not sure… if this code is slowing a website also down. hm?

    // [location id=""]
    function location_shortcode( $atts ) {
    
    	extract( shortcode_atts(
    		array(
    			'id' => '',
    			), $atts )
    	);
    
    	if ( isset( $id ) && get_field('adresse', $id) ) {
    
    	$google_map = get_field('adresse', $id);
    
    $url = 'https://maps.googleapis.com/maps/api/geocode/json?latlng='.$google_map['lat'].','.$google_map['lng'].'&sensor=true';
    $data = @file_get_contents($url);
    $jsondata = json_decode($data,true);
    if(is_array($jsondata) && $jsondata['status'] == "OK")
    {
    
    // city
    foreach ($jsondata["results"] as $result) {
        foreach ($result["address_components"] as $address) {
            if (in_array("locality", $address["types"])) {
                $city = $address["long_name"];
            }
        }
    }
    // country
    foreach ($jsondata["results"] as $result) {
        foreach ($result["address_components"] as $address) {
            if (in_array("country", $address["types"])) {
                $country = $address["long_name"];
            }
        }
    }
    
    }
    $seperator = ', ';
    
    $location = $city . $seperator . $country;
    
    return $location;
    
    }
    }
    add_shortcode( 'location', 'location_shortcode' );
Viewing 7 posts - 1 through 7 (of 7 total)