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 have over 200 customposts and each has customfields (add_city, add_state, add_location) in each custompost is googlmap with customfield (geo_longitude geo_latitude) Help please, display in googlmap multiple markers, depending on more meta_key meta_value. To sort kustomposts I use this beautiful code :

<?php $args = array(
'meta_query'=> array(
        'key' => 'add_state',
        'value'=> 'ill'
                    'key' => 'add_city',
                    'value' => 'chicago'
     ))); $posts = query_posts($args); ?>

On the details page, I use this code for googlmap:

        $add_arr = array();
            $add_arr[] = get_post_meta($post->ID,'address',true);
            $add_arr[] = get_post_meta($post->ID,'add_city',true);
            $add_arr[] = get_post_meta($post->ID,'add_state',true);

        $add_str = '';
            $add_str = implode(',',$add_arr);
            $geo_longitude = get_post_meta($post->ID,'geo_longitude',true);
            $geo_latitude = get_post_meta($post->ID,'geo_latitude',true);
    <div class="propertymap">

             <?php if($geo_longitude &&  $geo_latitude){

                    require_once (TEMPLATEPATH . '/library/map/preview_map.php');
            <iframe src="http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=<?php echo $add_str;?>&ie=UTF8&z=14&iwloc=A&output=embed" height="358" width="239" scrolling="no" frameborder="0" ></iframe>
            <?php }?></div>

Then I created a page and a lot of time trying to string any of these codes. He received only a white screen. Please help me solve this puzzle !!!

share|improve this question

The only way to get multiple markers on a map is to use the Google Maps API. https://developers.google.com/maps/documentation/javascript/tutorial.

The way you are referencing through an iframe only allows one marker(one location).

share|improve this answer

Well there are other ways how to get multiple markers on the map that do not involve any programming.. You can use http://www.copypastemap.com or google fussion tables. Sorry, can't help you if you insist on programming solution.

share|improve this answer

I found this awesome solution multiple locations, php, mysql, custom marker, fullscreen option, NO Google API key needed. Take a look

» SachingShare.com Blog Article

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.