Title: [Plugin: Events Manager] PHP Echo do_Shortcode help needed
Last modified: August 20, 2016

---

# [Plugin: Events Manager] PHP Echo do_Shortcode help needed

 *  Resolved [mtchairs](https://wordpress.org/support/users/mtchairs/)
 * (@mtchairs)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-events-manager-php-echo-do_shortcode-help-needed/)
 * Hi,
    I’m trying to use the following code to display a list of Current/Upcoming
   and Past Events at Venues that have been added using the directory theme, Vantage
   from Appthemes.
 * As you can see at this link [, it is displaying and repeating all the events that I’ve added so far. Can someone help me to get this right and limit the events shown to only those on at this particular venue?](http://www.theatregoer.com.au/listings/capitol-theatre/)
 *     ```
       <?php echo do_shortcode('[events_list]<h3>Current/Upcoming Events</h3>#_LOCATIONNEXTEVENTS<br/>
       <h3>Past Events</h3>#_LOCATIONPASTEVENTS[/events_list]'); ?>
       ```
   
 * Hope you can help!
 * [http://wordpress.org/extend/plugins/events-manager/](http://wordpress.org/extend/plugins/events-manager/)

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

 *  [agelonwl](https://wordpress.org/support/users/angelonwl/)
 * (@angelonwl)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-events-manager-php-echo-do_shortcode-help-needed/#post-2876516)
 * 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
 *  [agelonwl](https://wordpress.org/support/users/angelonwl/)
 * (@angelonwl)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-events-manager-php-echo-do_shortcode-help-needed/#post-2876517)
 * also, try to use the location shortcode like [location] – [http://wp-events-plugin.com/documentation/shortcodes/](http://wp-events-plugin.com/documentation/shortcodes/)
 *  Thread Starter [mtchairs](https://wordpress.org/support/users/mtchairs/)
 * (@mtchairs)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-events-manager-php-echo-do_shortcode-help-needed/#post-2876530)
 * 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 🙂
 *  [agelonwl](https://wordpress.org/support/users/angelonwl/)
 * (@angelonwl)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-events-manager-php-echo-do_shortcode-help-needed/#post-2876543)
 * 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.

 * ![](https://ps.w.org/events-manager/assets/icon-256x256.png?rev=3550347)
 * [Events Manager - Calendar, Bookings, Tickets, and more!](https://wordpress.org/plugins/events-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/events-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/events-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/events-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/events-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/events-manager/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [agelonwl](https://wordpress.org/support/users/angelonwl/)
 * Last activity: [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-events-manager-php-echo-do_shortcode-help-needed/#post-2876543)
 * Status: resolved