Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Filter output of Pronamic Google Maps WordPress

  • SOLVED

I'm trying to modify the [[LINK href="http://wordpress.org/extend/plugins/pronamic-google-maps/"]]Pronamic Google Maps[[/LINK]] output so that it will only show a map mashup from certain taxonomy terms only but I can't figure out how. I was hoping to use WP_query parameters to do it but it doesn't work, I would appreciate some help with this:


if(function_exists('pronamic_google_maps_mashup')) {
pronamic_google_maps_mashup(
array(
'post_type' => 'stores',
'taxonomy' => 'city',
'terms' => 'New York',
'operator' => 'NOT IN'
'nopaging' => true
) ,
array(
'width' => 800 ,
'height' => 600 ,
'map_type_id' => 'satellite' ,
'marker_options' => array(
'icon' => 'http://google-maps-icons.googlecode.com/files/photo.png'
)
)
);
}


Basically I want it to show all posts under CPT: [Stores] Under Taxonomy: [City] but EXCLUDE from TERM [New York], as in the above code, which does not work.

Here's the Plugin URL: http://wordpress.org/extend/plugins/pronamic-google-maps/

Answers (1)

2012-11-22

Arnav Joy answers:

try this

<?php
if(function_exists('pronamic_google_maps_mashup')) {

$term-slug = 'new-york'; // place slug here like new-york


pronamic_google_maps_mashup(



array(

'post_type' => 'stores',

'tax_query' => array(
array(
'taxonomy' => 'city',
'field' => 'slug',
'terms' => $term-slug ,
'operator' => 'NOT IN'
)
) ,

'nopaging' => true

) ,

array(

'width' => 800 ,

'height' => 600 ,

'map_type_id' => 'satellite' ,

'marker_options' => array(

'icon' => 'http://google-maps-icons.googlecode.com/files/photo.png'

)

)

);

}


Albert Shala comments:

Ah ha, I thought I tried that last night but guess not. Thank you Arnav!