WordPress.org

Support

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

[Resolved] [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: https://github.com/stephenh1988/Event-Organiser/blob/1.5.7/includes/event-organiser-venue-functions.php#L548

    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 noticed..lol)

    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 ‘[Resolved] [Plugin: Event Organiser] How do I add a map to the 'single-event' template?’ is closed to new replies.