Zip code search for integration into WordPress

Need assistance with a PHP script which will look up events within a specified mile search of a zip code and display them. The event zip codes are in the database as part of a WordPress custom post type without lat and long entries. I'm thinking a zip code table could be added with all zips/lat/long entries for the lookup. Tried a couple plug-ins and they are all too bulky, I’d dive into it myself but the time line for the project is short. I'd like the code to be as light as possible and delivered so I can pop it into my current setup. Thanks!

Or perhaps the lat and long could be looked up on the fly with Google Geocoding

The ongoing events are added via WordPress as a custom post type, each is added to the database as a single post. The zip code is a custom field in a separate table linked by the post ID. Each event will have its own zip code, multiple events may share a zip code.

The post entry is in the wp_posts table the zip code is stored in the wp_postmeta table linked by the post ID. It’s not a taxonomy but a custom field stored with a meta_key of zip_code and a meta_value of the actual zip code.

There is no current search page, what I’d like it to look like is enter any portion of an address and radius to search, returned is a Google map showing the events and a list below of events with pertinent event info.

If I was going to list all zip codes currently in the database I’d use the following:

<?php query_posts('post_type=event’);
if (have_posts()) : ?>
<?php while(have_posts()) : the_post();
$zips = get_post_meta($post->ID, 'zip_code', $single = true);
echo $zips;
<?php endwhile; ?>
<?php endif; ?>
<?php wp_reset_query(); ?>

Compétences : Géolocalisation, MySQL, PHP, WordPress

en voir plus : search for wordpress, code search, code line, wordpress zip code search php, codes code, zip code search, type code, search zip code, lat long, dive, wordpress custom search post type, wordpress custom post search, wordpress search post type, wordpress zip search, wordpress display custom post type, zip code mile search, search plug, database search wordpress, wordpress custom post type search, wordpress code integration, mile zip code, wordpress code short code, wordpress search database, lookup table php, php search database table

Concernant l'employeur :
( 4 commentaires ) Bay Area, United States

Nº du projet : #2344227

Décerné à:


Professional work from professionals!

%selectedBids___i_sum_sub_4% %project_currencyDetails_sign_sub_5% USD en 1 jour
(213 Commentaires)