Title: Zip Code entry by user?
Last modified: August 21, 2016

---

# Zip Code entry by user?

 *  Resolved [handhugsdesign](https://wordpress.org/support/users/handhugsdesign/)
 * (@handhugsdesign)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/zip-code-entry-by-user/)
 * Is there any way that I could add an input field where the user would put in 
   their zip code and the map would re-adjust based on what is close to them?
 * [https://wordpress.org/plugins/pronamic-google-maps/](https://wordpress.org/plugins/pronamic-google-maps/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [Miki80](https://wordpress.org/support/users/miki80/)
 * (@miki80)
 * [12 years ago](https://wordpress.org/support/topic/zip-code-entry-by-user/#post-4654572)
 * Hi, having bit of the same question.
    I am using WP User Frontend to create a
   custom field where people enter a country.
 * Using a function I can retrieve this field, but how can I insert a map that points
   to the specified country.
 * And as is there an option to put all posted countries in a mashup at my welcom
   page?
 * Can you please help.
 *  [patrick30](https://wordpress.org/support/users/patrick30/)
 * (@patrick30)
 * [12 years ago](https://wordpress.org/support/topic/zip-code-entry-by-user/#post-4654576)
 * This is something I am trying to do as well, where people can search using zip
   code or city. I am very close to it, I have got the search function to work and
   I have got the locations to load also, the only thing is that the map isn’t loading.
   If I find a solution, I will post it here for you.
 * Miki80: All the fields in address, longitude and latitude use custom fields, 
   you can do [add_post_meta](http://codex.wordpress.org/Function_Reference/add_post_meta)
   to populate the fields.
 * Now here you can either ask the user to enter their address and then convert 
   that address to latitude and longitude using geocoding, or you use the geocoding
   included in the plugin to do it in the frontend.
 * To convert an address to lat/long, you can try this link, there are many suggestions
   given
 * [http://stackoverflow.com/questions/98449/how-to-convert-an-address-to-a-latitude-longitude](http://stackoverflow.com/questions/98449/how-to-convert-an-address-to-a-latitude-longitude)
 *  [patrick30](https://wordpress.org/support/users/patrick30/)
 * (@patrick30)
 * [12 years ago](https://wordpress.org/support/topic/zip-code-entry-by-user/#post-4654577)
 * Miki80: I just did a quick test on this. I am also making a site where users 
   can post locations from frontend.
 * There is no need to do geocoding I guess.
 * You can try doing this when you save the post
 *     ```
       function new_post( $post_id ) {
         $address = filter_input( INPUT_POST, 'address', FILTER_SANITIZE_STRING );
   
         update_post_meta( $post_id, '_pronamic_google_maps_address', $address );
         update_post_meta( $post_id, '_pronamic_google_maps_active', true );
       }
   
       add_action( 'save_post', 'new_post' );
   
       // Create post object
       $new_post = array(
         'post_title'    => ''
       );
   
       wp_insert_post( $new_post );
       ```
   
 * You can try this and play around with this
 *  Plugin Author [Remco Tolsma](https://wordpress.org/support/users/remcotolsma/)
 * (@remcotolsma)
 * [12 years ago](https://wordpress.org/support/topic/zip-code-entry-by-user/#post-4654587)
 * [@handhugsdesign](https://wordpress.org/support/users/handhugsdesign/) i’ll mark
   this topis as resolved, if someone still has a question please open a new topic:
 * [http://wordpress.org/support/plugin/pronamic-google-maps](http://wordpress.org/support/plugin/pronamic-google-maps)
 *  Thread Starter [handhugsdesign](https://wordpress.org/support/users/handhugsdesign/)
 * (@handhugsdesign)
 * [12 years ago](https://wordpress.org/support/topic/zip-code-entry-by-user/#post-4654594)
 * Sorry – I dont see how any of these answered my original question. Does anyone
   have a solution to a simple zip code proximity search?
 *  [patrick30](https://wordpress.org/support/users/patrick30/)
 * (@patrick30)
 * [12 years ago](https://wordpress.org/support/topic/zip-code-entry-by-user/#post-4654595)
 * [@handhugsdesign](https://wordpress.org/support/users/handhugsdesign/) I will
   post a solution soon. I have managed to do the zip code search, now am just working
   on City search

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Zip Code entry by user?’ is closed to new replies.

 * ![](https://ps.w.org/pronamic-google-maps/assets/icon-256x256.png?rev=3194044)
 * [Pronamic Google Maps](https://wordpress.org/plugins/pronamic-google-maps/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pronamic-google-maps/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pronamic-google-maps/)
 * [Active Topics](https://wordpress.org/support/plugin/pronamic-google-maps/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pronamic-google-maps/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pronamic-google-maps/reviews/)

 * 6 replies
 * 4 participants
 * Last reply from: [patrick30](https://wordpress.org/support/users/patrick30/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/zip-code-entry-by-user/#post-4654595)
 * Status: resolved