-
Notifications
You must be signed in to change notification settings - Fork 76
/
shortcode-event-list.php
61 lines (48 loc) · 2.14 KB
/
shortcode-event-list.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
/**
* Event List Widget: Standard List
*
* The template is used for displaying the [eo_event] shortcode *unless* it is wrapped around a placeholder: e.g. [eo_event] {placeholder} [/eo_event].
*
* You can use this to edit how the output of the eo_event shortcode. See http://docs.wp-event-organiser.com/shortcodes/events-list
* For the event list widget see widget-event-list.php
*
* For a list of available functions (outputting dates, venue details etc) see http://codex.wp-event-organiser.com/
*
***************** NOTICE: *****************
* Do not make changes to this file. Any changes made to this file
* will be overwritten if the plug-in is updated.
*
* To overwrite this template with your own, make a copy of it (with the same name)
* in your theme directory. See http://docs.wp-event-organiser.com/theme-integration for more information
*
* WordPress will automatically prioritise the template in your theme directory.
***************** NOTICE: *****************
*
* @package Event Organiser (plug-in)
* @since 1.7
*/
global $eo_event_loop,$eo_event_loop_args;
//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() ) : ?>
<ul <?php echo $id; ?> class="<?php echo esc_attr( $classes );?>" >
<?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_get_event_datetime_format();
?>
<li class="<?php echo esc_attr( implode( ' ',$eo_event_classes ) ); ?>" >
<a href="<?php echo eo_get_permalink(); ?>"><?php the_title(); ?></a> <?php echo __( 'on','eventorganiser' ) . ' ' . eo_get_the_start( $format ); ?>
</li>
<?php endwhile; ?>
</ul>
<?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;