Support » Plugin: Event Organiser » [Plugin: Event Organiser] How do I add a map to the 'single-event' template?

Viewing 7 replies - 1 through 7 (of 7 total)
  • You can use eo_get_venue_map(). If used outside loop you need to pass the venue ID (as an integer) or the slug (as a string). Inside the loop, you can pass nothing and it’ll use the current event’s venue.

    You can see in the source here:

    The second, optional argument, is an array. Currently it supports the following keys (and their default values:)

    'zoom' => 15,
        'width' => '100%',
        'height' => '200px',
        'class' => '',//Apply a class to the map container

    Ok. I understand the ‘inside loop’ and ‘outside loop’ part..
    I put line 548-551 from your link in my template inside <?php … ?> tags..

    Didn’t work. Am I missing something?

    (Im kinda new to PHP if you haven’t

    i added

    <div class=”entry-map”><?php eo_get_venue_map(); ?></div>

    didn’t work..

    Thats the correct usage, if used inside the loop. What exactly doesn’t work? Does the map not render, or does it just show the sea? Does the venue map shorcode work ok?

    You don’t want to be copying the source in, just using the function as you have in your last post should work

    Does it work if you pass in a venue slug as the first argument?

    the map just doesn’t show up.
    checked the source code and it just shows the div tags.

    Sorry, my mistake!

    It should be `

    <div class="entry-map"><?php echo eo_get_venue_map(); ?></div>

    Apologies for any inconvenience.

    works now! thank you!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: Event Organiser] How do I add a map to the 'single-event' template?’ is closed to new replies.