I can’t find anything through a ton of searching. I have a page that will show about 5 different events and beside each post in it’s own div I want a map displayed that has the coordinates I added to that post.
EX
| map of street b || description of event b
| map of street j || description of event j
Is this possible?
Hello dmonaco83
Unfortunately there is no support to request a Map based off Post ID. What it does instead is take the global $post object that is set when using the WordPress Loop.
I would recommend instead to use WP_Query and call the_post() on the custom WP_Query. This would then let the map show correctly.
Some reading to help you:
http://codex.wordpress.org/Class_Reference/WP_Query
Hi Leon, I’m not sure to understand well your answer..
I put this code (posted below) into the loop of single.php But the map show all the map’s post.
I need to show just the place of the current post.. not all the posts’place..
Thank for an answer and sorry for my bad english!
<?php if ( function_exists( 'pronamic_google_maps_mashup' ) ) {
pronamic_google_maps_mashup (
array(
'post_type' => 'guida'
),
array(
'width' => 615,
'height' => 400,
'nopaging' => false
)
);
}
?>
Hello elisa.ghi
You are the same person as dmonaco83?
Your question seems different from what dmonaco83 was asking. For you, you don’t want to use the mashup, instead just pronamic_google_maps() will show you the map of the current post you are seeing.
Thank you very much Leon.. now it’s work perfectly.
I’m not dmonaco83, and probably I don’t understand well dmonaco83’s question because of I thinked that dmonaco83 has the same problem of me 🙁
I need to study english well.. Sorry end thank you so much!!!!