• Resolved Michael

    (@flinkthink)


    I’m really happy with the plugin so far.

    I have a lot of events with different locations but in the same town and I like to show them group by “location town”. Here is what I did:

    [locations_list scope="future" groupby="location_town" eventful="1" groupby_orderby="event_start_date, event_start_time"]
    #_LOCATIONTOWN
    #_LOCATIONNEXTEVENTS
    [/locations_list]

    The problem I have: #_LOCATIONNEXTEVENTS shows only one location within each town. How can I show all events and locations within a town?

    Best,
    Michael

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    you can try to override placeholder #_LOCATIONNEXTEVENTS using this custom snippet – https://pastebin.com/jT7XcrxK

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

    Thread Starter Michael

    (@flinkthink)

    Thank you very much!

    I’ve changed to code to this and it works:

    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('town'=>$EM_Location->location_town, 'scope'=>'future', 'limit'=>99) );
              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;
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘group by location doesn’t show all events to location’ is closed to new replies.