• Hi there,

    is it possible to group the list of events by month?
    I’ve got my eventlist on a single page and for that I edited shortcode-event-list.php. (see: https://host4.ssl-gesichert.at/ok-it_at/zvneu/veranstaltungskalender)

    I want the list to be displayed like this: https://www.ok-it.at/zv/neu/
    (October 2013 – October Events, November 2013 – November events, December 2013 – December events, etc.)

    My code:

    <?php
    global $eo_event_loop,$eo_event_loop_args;
    
    //Date % Time format for events
    $date_format = get_option('date_format');
    $time_format = get_option('time_format');
    
    //The list ID / classes
    $id = ( $eo_event_loop_args['id'] ? 'id="'.$eo_event_loop_args['id'].'"' : '' );
    $classes = $eo_event_loop_args['class'];
    
    ?>
    
    <?php if( $eo_event_loop->have_posts() ): ?>
    
    	<h2>N&auml;chste Veranstaltungen</h2>
    
    	<table <?php echo $id; ?> class="<?php echo esc_attr($classes);?>" >
         <tr>
    
    		<?php while( $eo_event_loop->have_posts() ): $eo_event_loop->the_post(); ?>
    
    			<?php
    				//Generate HTML classes for this event
    				$eo_event_classes = eo_get_event_classes(); 
    
    				//For non-all-day events, include time format
    				$format = ( eo_is_all_day() ? $date_format : $date_format.' '.$time_format );
    			?>
    
    			<td class="<?php echo esc_attr(implode(' ',$eo_event_classes)); ?>" width="180">
    			 <?php echo __('','eventorganiser') . ' '.eo_get_the_start('d.m. l', $post->ID,null,$post->occurrence_id) ; ?>
    			</td>
                <td width="250">
                 <b><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" ><?php the_title(); ?> &raquo; </a> </b>
                </td>
                <td>
                 <?php $venue_name = eo_get_venue_name(); ?>
                 <?php echo $venue_name; ?>
    			</td>
    		</tr>
    
    		<?php endwhile; ?>
    
    	</table>
    
    <?php elseif( ! empty($eo_event_loop_args['no_events']) ): ?>
    
    	<ul id="<?php echo esc_attr($id);?>" class="<?php echo esc_attr($classes);?>" >
    		<li class="eo-no-events" > <?php echo $eo_event_loop_args['no_events']; ?> </li>
    	</ul>
    
    <?php endif; ?>

    I’m an amateur in PHP Coding, so I hope to get a little help from you.

    Regards,
    cheasy

    https://www.ads-software.com/plugins/event-organiser/

  • The topic ‘Group events by month’ is closed to new replies.