Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?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;
- //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() ): ?>
- <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_is_all_day() ? $date_format : $date_format.' '.$time_format );
- ?>
- <div class="<?php echo esc_attr(implode(' ',$eo_event_classes)); ?>" >
- <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
- <?php
- $image_ids = get_post_meta($post->ID, 'poster');
- foreach ($image_ids as $image)
- {
- $myupload = get_post($image);
- echo wp_get_attachment_image( $image, 'poster-thumb' );
- }
- ?>
- </a>
- <h2><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" ><?php the_title(); ?></a></h2>
- <!-- List date/dates of film -->
- <?php
- $occurrences = eo_get_the_occurrences_of( get_the_ID() );
- $movieDates = array();
- foreach( $occurrences as $occurrence_id => $occurrence ) {
- $movieDates[] = $occurrence['start']->format('l, F jS, Y \a\t g:i A');
- }
- echo '<strong>' . implode( ' / ', $movieDates ) . '</strong>';
- ?>
- <?php $now = new DateTime( 'now', eo_get_blog_timezone() );
- if( $now <= eo_get_schedule_last( DATETIMEOBJ ) ) {
- $readMoreText = '<strong>More info / Buy tickets</strong>';
- } else {
- $readMoreText = "More info";
- } ?>
- <?php echo apply_filters('the_excerpt',get_the_excerpt().' <a href="'.get_permalink().'">' . $readMoreText . '</a>'); ?>
- </div>
- <div class="clear" style="clear:both;"></div>
- <?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; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement