Events Manager
List Recurring Events for Said Event (9 posts)

  1. rossing
    Posted 2 years ago #

    Hey all,
    Basically, I'm trying to add a feature to the events template that lists all the other future instances of a recurring event, so that when visitors click on one instance, all of the others will be listed on that post. I'm unable to figure this out in PHP or shortcode.


  2. caimin_nwl
    NetWebLogic Support
    Posted 2 years ago #


    Something like this should work:

    [events_list event="YOUR EVENT ID" recurrence="YOUR EVENT ID" scope="future"]

  3. rossing
    Posted 2 years ago #

    That works, but I'm trying to set it up so that any given instance of a recurring event will automatically list all instances of a recurring event in the post. I'm trying to use the post_id attribute as the recurrence, but it's not working.

  4. caimin_nwl
    NetWebLogic Support
    Posted 2 years ago #

    I'm not sure I follow 100% - you mean you want to list the recurring sequence on the event page?

  5. rossing
    Posted 2 years ago #

    Yes, in the single event page for one instance of a recurring event, I would want it to list all of the upcoming instances of the recurring event.

  6. angelo_nwl
    NetWebLogic Support
    Posted 2 years ago #

    you can create custom placeholder instead like http://pastebin.com/jT7XcrxK

    *replace location with event

    As for where to paste this : http://wp-events-plugin.com/tutorials/how-to-safely-add-php-code-to-wordpress/

  7. rossing
    Posted 2 years ago #

    Sorry, I'm still having trouble with this. I replaced "location" with event in the code each time, should I have only done it for the first one?

    This is the code I used in the functions.php:

    function my_em_placeholder_mod($replace, $EM_Location, $result){
            switch( $result ){
            case '#_LOCATIONNEXTEVENTS':
                    $events = EM_Events::get( array('event'=>$EM_event->event_id, 'scope'=>'future', 'limit'=>3) );
                    if ( count($events) > 0 ){
                            $replace = get_option('dbem_location_event_list_item_header_format');
                            foreach($events as $event){
                                    $replace .= $event->output(get_option('dbem_location_event_list_item_format'));
                            $replace .= get_option('dbem_location_event_list_item_footer_format');
                    } else {
                            $replace = get_option('dbem_location_no_events_message');
            return $replace;

    I'm using shortcode "[events_list] #_LOCATIONNEXTEVENTS [/events_list]"


  8. angelo_nwl
    NetWebLogic Support
    Posted 2 years ago #

    hmm, sorry for the confusion; so, in your single event page you've wanted to list other recurring event where this event belongs to?


    Recurring event 1-a = currently displayed

    List other recurrence:

    Recurring event 1-b
    Recurring event 1-c
    Recurring event 1-d

    did I get it right?

  9. rossing
    Posted 2 years ago #

    Yes, exactly, sorry for my muddled words!

    [Moderator Note: No bumping, thank you.]

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Events Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic