Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * The TEC template for a list of events. This includes the Past Events and Upcoming Events views
- * as well as those same views filtered to a specific category.
- *
- * You can customize this view by putting a replacement file of the same name (list.php) in the events/ directory of your theme.
- */
- // Don't load directly
- if ( !defined('ABSPATH') ) { die('-1'); }
- $event = array();
- $tribe_ecp = TribeEvents::instance();
- reset($tribe_ecp->metaTags); // Move pointer to beginning of array.
- foreach($tribe_ecp->metaTags as $tag){
- $var_name = str_replace('_Event','',$tag);
- $event[$var_name] = tribe_get_event_meta( $post->ID, $tag, true );
- }
- $event = (object) $event; //Easier to work with.
- ob_start();
- post_class($alt_text,$post->ID);
- $class = ob_get_contents();
- ob_end_clean();
- ?>
- <div class="upcoming">
- <hgroup><div class="icon"><div class="news"></div></div> <h3>Past Events</h3></hgroup>
- <?php $loop = new WP_Query( array( 'post_type' => 'tribe_events', 'posts_per_page' => 2, 'orderby' => 'date', 'order' => 'ASC', 'paged', 'eventDisplay' => 'past') ); ?>
- <ul id="list" class="small">
- <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
- <?php tribe_is_past($post->ID, 'tribe_is_past', true); ?>
- <li class="small">
- <a href="<?php the_permalink(); ?>"><?php if ( has_post_thumbnail() ) the_post_thumbnail('small-list-thumbnail'); ?></a>
- <span>
- <h4><?php the_title('<a href="' . tribe_get_event_link() . '" title="' . the_title_attribute('echo=0') . '" rel="bookmark">', '</a>'); ?> </h4>
- <?php echo tribe_get_start_date( null, false, 'd.m.y' ); ?> <br />
- <?php $venue = tribe_get_venue(); if ( !empty( $venue ) ) : ?><?php echo $venue; ?> <?php endif; ?>
- <?php $country = tribe_get_country(); if ( !empty( $country ) ) : ?><?php echo $country; ?> <?php endif; ?>
- </span>
- </li>
- <?php endwhile; ?>
- </ul>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement