WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been struggling with this for the last few days and just keep seem to get it right. Here's the situation:

I have a provider directory (hospitals) in a custom post type. The 2,000+ providers were imported via CSV with location data, for which I then used the geomashup plugin to add coordinates as meta info. So all the posts have the necessary components to getting this done.

Now what I need to do is build a search for on the frontpage that lets the user enter a zip code or city (text box), select a radius (in miles, from a dropdown list), and (optionality) a specialty (which is stored in a custom taxonomy).

I've messed with a loop based on the query info in the geomashup docs, but to no avail. I've been plugging in specific lat/long coordinates which should return results, yet nothing shows up.

Here's the query code I've been using:

$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;

$rq = new WP_Query( array(
    'posts_per_page' => 9999,
    'paged' => $paged,
    'geo_mashup_query' => array(
            'near_lat' => 26.055,
            'near_lng' => -80.153,
            'radius_mi' => 50,
) );

while ($rq->have_posts()) : $rq->the_post(); ?>

Ultimately, I need help figuring out how to configure the search form on the homepage, pass the variables to the search results page, and get results to show up. There are various "find nearby" plugins and answers here related to radius searches, but there are simply too many of these items and they needed to belong in a CPT w/ custom taxonomy and not be plugin based.

share|improve this question
You may have better luck asking this on the Geo Mashup support forum. – Dan Mar 12 '14 at 19:46
This is something I will be doing soon, so if you do post this somewhere else, please link to it here! Thanks... – neildeadman Mar 12 '14 at 22:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.