• Resolved dmonaco83

    (@dmonaco83)


    I have an Events custom post type and I am wondering how I display a different map per post? In my template I use:

    if ( function_exists( ‘pronamic_google_maps’ ) ) {
    pronamic_google_maps( array(
    ‘width’ => 290,
    ‘height’ => 200
    ) );
    }

    That just outputs a map but it’s defaulting to the first location it sees. Is there a place to add the post ID and tell it to take the map location from that post? This is all being run through a loop using wordpresses get_posts function.

    I hope that makes sense.

    http://wordpress.org/plugins/pronamic-google-maps/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter dmonaco83

    (@dmonaco83)

    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!!!!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Get different map per post?’ is closed to new replies.