Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * The template for a venue. By default it displays venue information and lists
- * events that occur at the specified venue.
- *
- * You can customize this view by putting a replacement file of the same name (single-venue.php) in the events/ directory of your theme.
- */
- // Don't load directly
- if ( !defined('ABSPATH') ) { die('-1'); }
- ?>
- <?php $venue_id = get_the_id(); ?>
- <span class="back"><a href="<?php echo tribe_get_events_link(); ?>"><?php _e('« Back to Events', 'tribe-events-calendar-pro'); ?></a></span>
- <div id="tribe-events-event-meta">
- <div style='margin: 0 0 10px 0; float: right;'>
- <?php echo tribe_get_embedded_map(get_the_ID(), '690px', '400px'); ?>
- </div>
- <dl class="column location" itemscope itemtype="http://schema.org/Place">
- <dt class="venue-label venue-label-name"><?php _e('Name:', 'tribe-events-calendar-pro'); ?></dt>
- <dd itemprop="name" class="venue-meta venue-meta-name"><?php the_title(); ?></dd>
- <?php if(tribe_get_phone()) : ?>
- <dt class="venue-label venue-label-phone"><?php _e('Phone:', 'tribe-events-calendar-pro'); ?></dt>
- <dd itemprop="telephone" class="venue-meta venue-meta-phone"><?php echo tribe_get_phone(); ?></dd>
- <?php endif; ?>
- <?php if( tribe_address_exists( get_the_ID() ) ) : ?>
- <dt class="venue-label venue-label-address">
- <?php _e('Address:', 'tribe-events-calendar-pro') ?><br />
- <?php if( get_post_meta( get_the_ID(), '_EventShowMapLink', true ) == 'true' ) : ?>
- <a class="gmap" itemprop="maps" href="<?php echo tribe_get_map_link(); ?>" title="<?php _e('Click to view a Google Map', 'tribe-events-calendar-pro'); ?>" target="_blank"><?php _e('Google Map', 'tribe-events-calendar-pro' ); ?></a>
- <?php endif; ?>
- </dt>
- <dd class="venue-meta venue-meta-address">
- <?php echo tribe_get_full_address( get_the_ID() ); ?>
- </dd>
- <?php endif; ?>
- <?php if ( get_the_content() != ''): ?>
- <dt class="venue-label venue-label-description"><?php _e('Description:', 'tribe-events-calendar-pro'); ?></dt>
- <dd class="venue-meta venue-meta-description"><?php the_content(); ?></dd>
- <?php endif ?>
- </dl>
- </div>
- <div id="tribe-events-loop" class="tribe-events-events post-list clearfix upcoming venue-events">
- <?php
- $venueEvents = tribe_get_events(array('venue'=>get_the_ID(), 'eventDisplay' => 'upcoming', 'posts_per_page' => -1));
- global $post;
- $first = true;
- ?>
- <?php if( sizeof($venueEvents) > 0 ): ?>
- <h2 class='tribe-events-cal-title'>Upcoming Events At This Venue</h2>
- <div id="tribe-events-content" class="events-archive">
- <?php foreach( $venueEvents as $post ):
- setup_postdata($post); ?>
- <div id="post-<?php the_ID(); ?>" <?php post_class($first ? 'tribe-events-event clearfix first': 'tribe-events-event clearfix' ); $first = false; ?> itemscope itemtype="http://schema.org/Event">
- <?php if ( tribe_is_new_event_day() ) : ?>
- <h4 class="event-day"><?php echo tribe_get_start_date( null, false ); ?></h4>
- <?php endif; ?>
- <?php the_title('<h2 class="entry-title" itemprop="name"><a href="' . tribe_get_event_link() . '" title="' . the_title_attribute('echo=0') . '" rel="bookmark" itemprop="url">', '</a></h2>'); ?>
- <div class="entry-content tribe-events-event-entry" itemprop="description">
- <?php has_excerpt() ? the_excerpt() : the_content() ?>
- </div> <!-- End tribe-events-event-entry -->
- <div class="tribe-events-event-list-meta">
- <table>
- <?php if (tribe_is_multiday() || tribe_get_all_day() != 'yes'): ?>
- <tr>
- <td class="tribe-events-event-meta-desc"><?php _e('Start:', 'tribe-events-calendar-pro'); ?></td>
- <td class="tribe-events-event-meta-value"><meta itemprop="startDate" content="<?php echo tribe_get_start_date( null, false, 'Y-m-d' ); ?>" /><?php echo tribe_get_start_date(); ?></td>
- </tr>
- <tr>
- <td class="tribe-events-event-meta-desc"><?php _e('End:', 'tribe-events-calendar-pro'); ?></td>
- <td class="tribe-events-event-meta-value"><meta itemprop="endDate" content="<?php echo tribe_get_end_date( null, false, 'Y-m-d' ); ?>" /><?php echo tribe_get_end_date(); ?></td>
- </tr>
- <?php else: ?>
- <tr>
- <td class="tribe-events-event-meta-desc"><?php _e('Date:', 'tribe-events-calendar-pro'); ?></td>
- <td class="tribe-events-event-meta-value"><meta itemprop="startDate" content="<?php echo tribe_get_start_date( null, false, 'Y-m-d' ); ?>" /><?php echo tribe_get_start_date(); ?></td>
- </tr>
- <?php endif; ?>
- <?php
- $cost = tribe_get_cost();
- if ( !empty( $cost ) ) :
- ?>
- <tr>
- <td class="tribe-events-event-meta-desc"><?php _e('Cost:', 'tribe-events-calendar-pro'); ?></td>
- <td class="tribe-events-event-meta-value" itemprop="price"><?php echo $cost; ?></td>
- </tr>
- <?php endif; ?>
- </table>
- </div>
- </div> <!-- End post -->
- <?php endforeach; ?>
- <?php endif; ?>
- <?php // Reset the post and id to the venue post before comments template shows up.
- $post = get_post($venue_id);
- global $id;
- $id = $venue_id;?>
- </div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement