wordpress-geo-mashup
wordpress-geo-mashup copied to clipboard
Restrict map by meta values
Hi,
I'm looking a way to restrict my post by metavalues
I was trying pre_get_posts without success ....
Someting like that would be great :
$args_map = array( 'map_post_type' => 'mycpt', 'meta_query' => array( array( 'key' => '_rdv_cons_id', 'value' => $cons_id, 'compare' => '=' ) ) );
echo GeoMashup::map($args_map);
or Someone know how to achieve that ?
Thanks
I tried https://wordpress.org/support/topic/filter-by-meta_key?replies=5 in my template page.
<?php query_posts( 'tag=example' ); ?>
<?php echo GeoMashup::map( 'map_content=contextual' ); ?>
<?php wp_reset_query(); ?>
Without success...
GOT IT !
I wrote 'key' and not 'meta_key'.......
Here if it can help :
query_posts( array ('post_type' => 'da_cpt',
'meta_query' => array(
array(
'meta_key' => '_rdv_cons_id',
'value' => 7, // make it dynamic
'compare' => '=',
'type' => 'NUMERIC'
)
)
)
);
echo GeoMashup::map( 'map_content=contextual' );
wp_reset_query();
In fact no, it seems not working...