Viewing 4 replies - 1 through 4 (of 4 total)
  • hi,

    you can use this instead

    <?php
    echo do_shortcode('[events_list scope="future" limit=1 location=x]<h3>Current/Upcoming Events</h3>#_LOCATIONNEXTEVENTS[/events_list]');
    echo do_shortcode('[events_list scope="past" limit=1 location=x]<h3>Past Events</h3>#_LOCATIONPASTEVENTS[/events_list]');
    ?>

    then you can either add limit=1 or location=x where x is your location id

    also, try to use the location shortcode like [location] – http://wp-events-plugin.com/documentation/shortcodes/

    Thread Starter mtchairs

    (@mtchairs)

    Thanks so much for the help. I’m trying to enter this code into my theme’s single listing template so is there a way to tell it to find events for whichever location the template is being used for rather than having to specify a particular location ID? I was able to enter the short code in the location description and that works but it would be easier to use a template if that’s possible?

    Thanks again 🙂

    using template file at templates/location-single.php; you can try this one

    <?php
    global $EM_Location;
    $location_id =  $EM_Location->output("#_LOCATIONID"); ?>
    <h3>Current/Upcoming Events</h3>
    <ul>
    <?php echo do_shortcode("[events_list scope='future' location='$location_id']<li>#_EVENTLINK</li>[/events_list]"); ?>
    </ul>
    <h3>Past Events</h3>
    <ul>
    <?php echo do_shortcode("[events_list scope='past' location='$location_id']<li>#_EVENTLINK</li>[/events_list]"); ?>
    </ul>

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘[Plugin: Events Manager] PHP Echo do_Shortcode help needed’ is closed to new replies.