Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * A single event. This displays the event title, description, meta, and
- * optionally, the Google map for the event.
- *
- * You can customize this view by putting a replacement file of the same name (single.php) in the events/ directory of your theme.
- */
- // Don't load directly
- if ( !defined('ABSPATH') ) { die('-1'); }
- global $wootickets_pricing;
- global $wootickets_no_show;
- $wootickets_no_show = true;
- ?>
- <span class="back"><a href="<?php echo tribe_get_events_link(); ?>"><?php _e('« Back to Events', 'tribe-events-calendar'); ?></a></span>
- <?php
- $gmt_offset = (get_option('gmt_offset') >= '0' ) ? ' +' . get_option('gmt_offset') : " " . get_option('gmt_offset');
- $gmt_offset = str_replace( array( '.25', '.5', '.75' ), array( ':15', ':30', ':45' ), $gmt_offset );
- if (strtotime( tribe_get_end_date(get_the_ID(), false, 'Y-m-d G:i') . $gmt_offset ) <= time() ) { ?><div class="event-passed"><?php _e('This event has passed.', 'tribe-events-calendar'); ?></div><?php } ?>
- <div id="tribe-events-event-meta" itemscope itemtype="http://schema.org/Event">
- <div class="eventscolumns"> <!-- our own wrapper -->
- <dl class="column">
- <dt class="event-label event-label-name"><?php _e('Event:', 'tribe-events-calendar'); ?></dt>
- <dd itemprop="name" class="event-meta event-meta-name"><span class="summary"><?php the_title(); ?></span></dd>
- <?php if (tribe_get_start_date() !== tribe_get_end_date() ) { ?>
- <dt class="event-label event-label-start"><?php _e('Start:', 'tribe-events-calendar'); ?></dt>
- <dd class="event-meta event-meta-start"><meta itemprop="startDate" content="<?php echo tribe_get_start_date( null, false, 'Y-m-d-h:i:s' ); ?>"/><?php echo tribe_get_start_date(); ?></dd>
- <dt class="event-label event-label-end"><?php _e('End:', 'tribe-events-calendar'); ?></dt>
- <dd class="event-meta event-meta-end"><meta itemprop="endDate" content="<?php echo tribe_get_end_date( null, false, 'Y-m-d-h:i:s' ); ?>"/><?php echo tribe_get_end_date(); ?></dd>
- <?php } else { ?>
- <dt class="event-label event-label-date"><?php _e('Date:', 'tribe-events-calendar'); ?></dt>
- <dd class="event-meta event-meta-date"><meta itemprop="startDate" content="<?php echo tribe_get_start_date( null, false, 'Y-m-d-h:i:s' ); ?>"/><?php echo tribe_get_start_date(); ?></dd>
- <?php } ?>
- <?php if(tribe_get_venue()) : ?>
- <dt class="event-label event-label-venue"><?php _e('Venue:', 'tribe-events-calendar'); ?></dt>
- <dd itemprop="name" class="event-meta event-meta-venue">
- <?php if( class_exists( 'TribeEventsPro' ) ): ?>
- <?php tribe_get_venue_link( get_the_ID(), class_exists( 'TribeEventsPro' ) ); ?>
- <?php else: ?>
- <?php echo tribe_get_venue( get_the_ID() ); ?>
- <?php endif; ?>
- </dd>
- <?php endif; ?>
- <!-- Lets try grabbing the Location City -->
- <?php
- $city = tribe_get_city();
- if ( !empty( $city ) ) :
- ?>
- <dt class="event-label event-label-city"><?php _e('Location:', 'tribe-events-calendar'); ?></dt>
- <dd itemprop="city" class="event-meta event-meta-venue">
- <?php echo $city; ?>
- </dd>
- <?php endif; ?>
- <!-- tribe_get_city -->
- <?php if( tribe_address_exists( get_the_ID() ) ) : ?>
- <dt class="event-label event-label-address">
- <?php _e('Addressley:', 'tribe-events-calendar') ?><br />
- <?php if( tribe_show_google_map_link( get_the_ID() ) ) : ?>
- <a class="gmap" itemprop="maps" href="<?php echo tribe_get_map_link(); ?>" title="<?php _e('Click to view a Google Map', 'tribe-events-calendar'); ?>" target="_blank"><?php _e('Google Map', 'tribe-events-calendar' ); ?></a>
- <?php endif; ?>
- </dt>
- <dd class="event-meta event-meta-address">
- <?php echo tribe_get_full_address( get_the_ID() ); ?>
- </dd>
- <?php endif; ?>
- <dt class="event-label event-label-cost"><?php _e('Cost:', 'tribe-events-calendar'); ?></dt>
- <dd itemprop="price" class="event-meta event-meta-cost eventpricetable">
- <?php
- tribe_get_ticket_form();
- $price_differential = max($wootickets_pricing) > min($wootickets_pricing);
- if (count($wootickets_pricing) === 1 or !price_differential) {
- $price = woocommerce_price($wootickets_pricing[0]);
- echo "$price";
- }
- elseif (count($wootickets_pricing) > 1) {
- $from = woocommerce_price(min($wootickets_pricing));
- $to = woocommerce_price(max($wootickets_pricing));
- echo "Tickets from $from – $to";
- } ?>
- </dd>
- <!-- This should bring in ticket add-to-cart button - now in functions.php -->
- <?php add_to_cart_wooticket_btns() ?>
- </dl>
- <dl class="column last" itemprop="location" itemscope itemtype="http://schema.org/Place">
- <?php if( function_exists('tribe_the_custom_fields') && tribe_get_custom_fields( get_the_ID() ) ): ?>
- <?php tribe_the_custom_fields( get_the_ID() ); ?>
- <?php endif; ?>
- <!-- </div> -->
- <?php if( tribe_embed_google_map( get_the_ID() ) ) : ?>
- <?php if( tribe_address_exists( get_the_ID() ) ) { echo tribe_get_embedded_map(); } ?>
- <?php endif; ?>
- </dl>
- </div> <!-- eof of our own wrapper -->
- </div>
- <div class="entry-content">
- <?php
- if ( function_exists('has_post_thumbnail') && has_post_thumbnail() ) {?>
- <?php the_post_thumbnail(); ?>
- <?php } ?>
- <div class="summary"><?php the_content(); ?></div>
- <?php // if (function_exists('tribe_get_ticket_form') && tribe_get_ticket_form()) { tribe_get_ticket_form(); } ?>
- </div>
- <?php if( function_exists('tribe_get_single_ical_link') ): ?>
- <a class="ical single" href="<?php echo tribe_get_single_ical_link(); ?>"><?php _e('iCal Import', 'tribe-events-calendar'); ?></a>
- <?php endif; ?>
- <?php if( function_exists('tribe_get_gcal_link') ): ?>
- <a href="<?php echo tribe_get_gcal_link(); ?>" class="gcal-add" title="<?php _e('Add to Google Calendar', 'tribe-events-calendar'); ?>"><?php _e('+ Google Calendar', 'tribe-events-calendar'); ?></a>
- <?php endif; ?>
- <div style="clear:both"></div>
Advertisement
Add Comment
Please, Sign In to add comment