Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * The TEC template for a list of events. This has been modified to
- * remove:
- *
- * .tribe-events-event-list-meta table
- */
- // Don't load directly
- if ( !defined('ABSPATH') ) { die('-1'); }
- ?>
- <div id="tribe-events-content" class="upcoming">
- <?php if(!tribe_is_day()): // day view doesn't have a grid ?>
- <div id='tribe-events-calendar-header' class="clearfix">
- <span class='tribe-events-calendar-buttons'>
- <a class='tribe-events-button-on' href='<?php echo tribe_get_listview_link(); ?>'><?php _e('Event List', 'tribe-events-calendar')?></a>
- <a class='tribe-events-button-off' href='<?php echo tribe_get_gridview_link(); ?>'><?php _e('Calendar', 'tribe-events-calendar')?></a>
- </span>
- </div><!--tribe-events-calendar-header-->
- <?php endif; ?>
- <div id="tribe-events-loop" class="tribe-events-events post-list clearfix">
- <?php if (have_posts()) : ?>
- <?php $hasPosts = true; $first = true; ?>
- <?php while ( have_posts() ) : the_post(); ?>
- <?php global $more; $more = false; ?>
- <div id="post-<?php the_ID() ?>" <?php post_class('tribe-events-event clearfix') ?> itemscope itemtype="http://schema.org/Event">
- <?php if ( tribe_is_new_event_day() && !tribe_is_day() ) : ?>
- <h4 class="event-day"><?php echo tribe_get_start_date( null, false ); ?></h4>
- <?php endif; ?>
- <?php if ( tribe_is_day() && $first ) : $first = false; ?>
- <h4 class="event-day"><?php echo tribe_event_format_date(strtotime(get_query_var('eventDate')), false); ?></h4>
- <?php endif; ?>
- <?php if ( function_exists('has_post_thumbnail') && has_post_thumbnail() ) {?>
- <?php
- /**
- * One final variation could be to register a new post thumbnail
- * size and use that in place of the default "post-thumbnail"
- * size. Here I have used the notional "event-thumbnail" size.
- *
- * You would specify the target size in the thumbnail registration
- * code, the benefit of this approach being that the image sent
- * to the browser would be the correct size straight off the bat,
- * no wasted bandwidth.
- *
- * If you want to find about more about registering post
- * thumbnail sizes then see the following link.
- *
- * @see http://codex.wordpress.org/Function_Reference/add_image_size
- */
- the_post_thumbnail('event-thumbnail', array(
- 'class' => 'featured-event-thumb',
- )); ?>
- <?php } ?>
- <?php the_title('<h2 class="entry-title" itemprop="name"><a href="' . tribe_get_event_link() . '" title="' . the_title_attribute('echo=0') . '" rel="bookmark">', '</a></h2>'); ?>
- <div class="entry-content tribe-events-event-entry" itemprop="description">
- <?php if (has_excerpt ()): ?>
- <?php the_excerpt(); ?>
- <?php else: ?>
- <?php the_content(); ?>
- <?php endif; ?>
- </div> <!-- End tribe-events-event-entry -->
- </div> <!-- End post -->
- <?php endwhile;// posts ?>
- <?php else :?>
- <?php
- $tribe_ecp = TribeEvents::instance();
- if ( is_tax( $tribe_ecp->get_event_taxonomy() ) ) {
- $cat = get_term_by( 'slug', get_query_var('term'), $tribe_ecp->get_event_taxonomy() );
- if( tribe_is_upcoming() ) {
- $is_cat_message = sprintf(__(' listed under %s. Check out past events for this category or view the full calendar.','tribe-events-calendar'),$cat->name);
- } else if( tribe_is_past() ) {
- $is_cat_message = sprintf(__(' listed under %s. Check out upcoming events for this category or view the full calendar.','tribe-events-calendar'),$cat->name);
- }
- }
- ?>
- <?php if(tribe_is_day()): ?>
- <?php printf( __('No events scheduled for <strong>%s</strong>. Please try another day.', 'tribe-events-calendar'), date_i18n('F d, Y', strtotime(get_query_var('eventDate')))); ?>
- <?php endif; ?>
- <?php if(tribe_is_upcoming()){ ?>
- <?php _e('No upcoming events', 'tribe-events-calendar');
- echo !empty($is_cat_message) ? $is_cat_message : ".";?>
- <?php }elseif(tribe_is_past()){ ?>
- <?php _e('No previous events' , 'tribe-events-calendar');
- echo !empty($is_cat_message) ? $is_cat_message : ".";?>
- <?php } ?>
- <?php endif; ?>
- </div><!-- #tribe-events-loop -->
- <div id="tribe-events-nav-below" class="tribe-events-nav clearfix">
- <div class="tribe-events-nav-previous"><?php
- // Display Previous Page Navigation
- if( tribe_is_upcoming() && get_previous_posts_link() ) : ?>
- <?php previous_posts_link( '<span>'.__('« Previous Events', 'tribe-events-calendar').'</span>' ); ?>
- <?php elseif( tribe_is_upcoming() && !get_previous_posts_link( ) ) : ?>
- <a href='<?php echo tribe_get_past_link(); ?>'><span><?php _e('« Previous Events', 'tribe-events-calendar' ); ?></span></a>
- <?php elseif( tribe_is_past() && get_next_posts_link( ) ) : ?>
- <?php next_posts_link( '<span>'.__('« Previous Events', 'tribe-events-calendar').'</span>' ); ?>
- <?php endif; ?>
- </div>
- <div class="tribe-events-nav-next"><?php
- // Display Next Page Navigation
- if( tribe_is_upcoming() && get_next_posts_link( ) ) : ?>
- <?php next_posts_link( '<span>'.__('Next Events »', 'tribe-events-calendar').'</span>' ); ?>
- <?php elseif( tribe_is_past() && get_previous_posts_link( ) ) : ?>
- <?php previous_posts_link( '<span>'.__('Next Events »', 'tribe-events-calendar').'</span>' ); // a little confusing but in 'past view' to see newer events you want the previous page ?>
- <?php elseif( tribe_is_past() && !get_previous_posts_link( ) ) : ?>
- <a href='<?php echo tribe_get_upcoming_link(); ?>'><span><?php _e('Next Events »', 'tribe-events-calendar'); ?></span></a>
- <?php endif; ?>
- </div>
- </div>
- <?php if ( !empty($hasPosts) && function_exists('tribe_get_ical_link') ): ?>
- <a title="<?php esc_attr_e('iCal Import', 'tribe-events-calendar') ?>" class="ical" href="<?php echo tribe_get_ical_link(); ?>"><?php _e('iCal Import', 'tribe-events-calendar') ?></a>
- <?php endif; ?>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement