WordPress.org

Support

Support » Plugins and Hacks » Events Manager » List Recurring Events for Said Event

List Recurring Events for Said Event

  • 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.
    Thanks!

    http://wordpress.org/plugins/events-manager/

Viewing 8 replies - 1 through 8 (of 8 total)
  • caimin_nwl

    @caimin_nwl

    NetWebLogic Support

    Hi,

    Something like this should work:

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

    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.

    caimin_nwl

    @caimin_nwl

    NetWebLogic Support

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

    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.

    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/

    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:

    add_filter('em_location_output_placeholder','my_em_placeholder_mod',1,3);
    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');
                    }
                    break;
            }
            return $replace;
    }

    I’m using shortcode “[events_list] #_LOCATIONNEXTEVENTS [/events_list]”

    Thanks!

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

    eg.

    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?

    Yes, exactly, sorry for my muddled words!

    [Moderator Note: No bumping, thank you.]

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘List Recurring Events for Said Event’ is closed to new replies.
Skip to toolbar