You must use the template tag to do this:
<?php
$custom_query = new WP_Query( array(
'post_type' => 'thing',
'posts_per_page' => -1,
'meta_key' => 'color',
'meta_value' => 'blue',
) );
echo GeoMashup::map( array(
'map_content' => $custom_query,
) );
?>
Hi Dylan,
thanks for that fastest response. I´ll try the code!
Hi Dylan,
I’ve tried the code but unfortunately it is not working.
I´ve tried the code
<?php
$custom_query = new WP_Query( array(
‘post_type’ => ‘kommune’,
‘posts_per_page’ => -1,
‘meta_key’ => ‘Friedhofsatzung’,
‘meta_value’ => ‘Friedhofsatzungsbeschluss’,
) );
echo GeoMashup::map( array(
‘map_content’ => $custom_query,
‘width’ => 500,
‘height’ => 600,
‘zoom’ => 6,
‘center_lat’ => 51.2,
‘center_lng’ => 10,
‘map_type’ => ‘G_HYBRID_MAP’,
‘cluster_max_zoom’ => 0,
‘add_overview_control’ => ‘false’,
‘add_map_type_control’ => ‘false’,
‘interactive_legend’ => ‘false’,
‘name’ => ‘friedhofsatzungen’
) );
?>
in the theme template and directly in the page.
The
‘map_content’ => $custom_query,
in the echo block seems to produce an problem – the page is not loading completely.
I´ve also tried to put the map_post_type attribute to the shortcode – this is not working, too.
Do you have an idea, what I´m doing wrong?
Thanks
bernhard
Looks okay to me. The code must go in the page template. There may be more clues in your PHP error logs if there is a syntax problem there.
Thanks a lot Dylan! It works! I´ve tried first in a test environment with an older version of the plugin. Sorry!!