SHOW:
|
|
- or go back to the newest paste.
| 1 | <?php | |
| 2 | /** | |
| 3 | - | * Template for a single event. |
| 3 | + | * Amended single event template. Labels added to the prev/next event links |
| 4 | - | * |
| 4 | + | * (toward the bottom of this template) |
| 5 | - | * It's been changed slightly so that the featured image, if one exists, |
| 5 | + | |
| 6 | - | * displays near to the top (just below the "Back to Events" link). |
| 6 | + | |
| 7 | // Don't load directly | |
| 8 | if ( !defined('ABSPATH') ) { die('-1'); }
| |
| 9 | ?> | |
| 10 | <span class="back" xmlns="http://www.w3.org/1999/html"><a href="<?php echo tribe_get_events_link(); ?>"><?php _e('« Back to Events', 'tribe-events-calendar'); ?></a></span>
| |
| 11 | <?php | |
| 12 | if ( function_exists('has_post_thumbnail') && has_post_thumbnail() ) {
| |
| 13 | the_post_thumbnail(); | |
| 14 | } | |
| 15 | ||
| 16 | $gmt_offset = (get_option('gmt_offset') >= '0' ) ? ' +' . get_option('gmt_offset') : " " . get_option('gmt_offset');
| |
| 17 | $gmt_offset = str_replace( array( '.25', '.5', '.75' ), array( ':15', ':30', ':45' ), $gmt_offset ); | |
| 18 | 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 } ?>
| |
| 19 | <div id="tribe-events-event-meta" itemscope itemtype="http://schema.org/Event"> | |
| 20 | <dl class="column"> | |
| 21 | <dt class="event-label event-label-name"><?php _e('Event:', 'tribe-events-calendar') ?></dt>
| |
| 22 | <dd itemprop="name" class="event-meta event-meta-name"><span class="summary"><?php the_title() ?></span></dd> | |
| 23 | <?php if (tribe_get_start_date() !== tribe_get_end_date() ) { ?>
| |
| 24 | <dt class="event-label event-label-start"><?php _e('Start:', 'tribe-events-calendar') ?></dt>
| |
| 25 | <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> | |
| 26 | <dt class="event-label event-label-end"><?php _e('End:', 'tribe-events-calendar') ?></dt>
| |
| 27 | <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> | |
| 28 | <?php } else { ?>
| |
| 29 | <dt class="event-label event-label-date"><?php _e('Date:', 'tribe-events-calendar') ?></dt>
| |
| 30 | <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> | |
| 31 | <?php } ?> | |
| 32 | <?php if ( tribe_get_cost() ) : ?> | |
| 33 | <dt class="event-label event-label-cost"><?php _e('Cost:', 'tribe-events-calendar') ?></dt>
| |
| 34 | <dd itemprop="price" class="event-meta event-meta-cost"><?php echo tribe_get_cost(); ?></dd> | |
| 35 | <?php endif; ?> | |
| 36 | <?php tribe_meta_event_cats(); ?> | |
| 37 | <?php if ( tribe_get_organizer_link( get_the_ID(), false, false ) ) : ?> | |
| 38 | <dt class="event-label event-label-organizer"><?php _e('Organizer:', 'tribe-events-calendar') ?></dt>
| |
| 39 | <dd class="vcard author event-meta event-meta-author"><span class="fn url"><?php echo tribe_get_organizer_link(); ?></span></dd> | |
| 40 | <?php elseif (tribe_get_organizer()): ?> | |
| 41 | <dt class="event-label event-label-organizer"><?php _e('Organizer:', 'tribe-events-calendar') ?></dt>
| |
| 42 | <dd class="vcard author event-meta event-meta-author"><span class="fn url"><?php echo tribe_get_organizer(); ?></span></dd> | |
| 43 | <?php endif; ?> | |
| 44 | <?php if ( tribe_get_organizer_phone() ) : ?> | |
| 45 | <dt class="event-label event-label-organizer-phone"><?php _e('Phone:', 'tribe-events-calendar') ?></dt>
| |
| 46 | <dd itemprop="telephone" class="event-meta event-meta-phone"><?php echo tribe_get_organizer_phone(); ?></dd> | |
| 47 | <?php endif; ?> | |
| 48 | <?php if ( tribe_get_organizer_email() ) : ?> | |
| 49 | <dt class="event-label event-label-email"><?php _e('Email:', 'tribe-events-calendar') ?></dt>
| |
| 50 | <dd itemprop="email" class="event-meta event-meta-email"><a href="mailto:<?php echo tribe_get_organizer_email(); ?>"><?php echo tribe_get_organizer_email(); ?></a></dd> | |
| 51 | <?php endif; ?> | |
| 52 | <dt class="event-label event-label-updated"><?php _e('Updated:', 'tribe-events-calendar') ?></dt>
| |
| 53 | <dd class="event-meta event-meta-updated"><span class="date updated"><?php the_date(); ?></span></dd> | |
| 54 | <?php if ( class_exists('TribeEventsRecurrenceMeta') && function_exists('tribe_get_recurrence_text') && tribe_is_recurring_event() ) : ?>
| |
| 55 | <dt class="event-label event-label-schedule"><?php _e('Schedule:', 'tribe-events-calendar') ?></dt>
| |
| 56 | <dd class="event-meta event-meta-schedule"><?php echo tribe_get_recurrence_text(); ?> | |
| 57 | <?php if( class_exists('TribeEventsRecurrenceMeta') && function_exists('tribe_all_occurences_link')): ?>(<a href='<?php tribe_all_occurences_link() ?>'>See all</a>)<?php endif; ?>
| |
| 58 | </dd> | |
| 59 | <?php endif; ?> | |
| 60 | </dl> | |
| 61 | <dl class="column" itemprop="location" itemscope itemtype="http://schema.org/Place"> | |
| 62 | <?php if(tribe_get_venue()) : ?> | |
| 63 | <dt class="event-label event-label-venue"><?php _e('Venue:', 'tribe-events-calendar') ?></dt>
| |
| 64 | <dd itemprop="name" class="event-meta event-meta-venue"> | |
| 65 | <?php if( class_exists( 'TribeEventsPro' ) ): ?> | |
| 66 | <?php tribe_get_venue_link( get_the_ID(), class_exists( 'TribeEventsPro' ) ); ?> | |
| 67 | <?php else: ?> | |
| 68 | <?php echo tribe_get_venue( get_the_ID() ) ?> | |
| 69 | <?php endif; ?> | |
| 70 | </dd> | |
| 71 | <?php endif; ?> | |
| 72 | <?php if(tribe_get_phone()) : ?> | |
| 73 | <dt class="event-label event-label-venue-phone"><?php _e('Phone:', 'tribe-events-calendar') ?></dt>
| |
| 74 | <dd itemprop="telephone" class="event-meta event-meta-venue-phone"><?php echo tribe_get_phone(); ?></dd> | |
| 75 | <?php endif; ?> | |
| 76 | <?php if( tribe_address_exists( get_the_ID() ) ) : ?> | |
| 77 | <dt class="event-label event-label-address"> | |
| 78 | <?php _e('Address:', 'tribe-events-calendar') ?><br />
| |
| 79 | <?php if( tribe_show_google_map_link( get_the_ID() ) ) : ?> | |
| 80 | <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>
| |
| 81 | <?php endif; ?> | |
| 82 | </dt> | |
| 83 | <dd class="event-meta event-meta-address"> | |
| 84 | <?php echo tribe_get_full_address( get_the_ID() ); ?> | |
| 85 | </dd> | |
| 86 | <?php endif; ?> | |
| 87 | </dl> | |
| 88 | ||
| 89 | <?php if( function_exists('tribe_the_custom_fields') && tribe_get_custom_fields( get_the_ID() ) ): ?>
| |
| 90 | <?php tribe_the_custom_fields( get_the_ID() ); ?> | |
| 91 | <?php endif; ?> | |
| 92 | </div> | |
| 93 | <?php if( tribe_embed_google_map( get_the_ID() ) ) : ?> | |
| 94 | <?php if( tribe_address_exists( get_the_ID() ) ) { echo tribe_get_embedded_map(); } ?>
| |
| 95 | <?php endif; ?> | |
| 96 | <div class="entry"> | |
| 97 | <div class="summary"><?php the_content() ?></div> | |
| 98 | <?php if (function_exists('tribe_get_ticket_form') && tribe_get_ticket_form()) { tribe_get_ticket_form(); } ?>
| |
| 99 | </div> | |
| 100 | <?php if( function_exists('tribe_get_single_ical_link') ): ?>
| |
| 101 | <a class="ical single" href="<?php echo tribe_get_single_ical_link(); ?>"><?php _e('iCal Import', 'tribe-events-calendar'); ?></a>
| |
| 102 | <?php endif; ?> | |
| 103 | <?php if( function_exists('tribe_get_gcal_link') ): ?>
| |
| 104 | <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>
| |
| 105 | <?php endif; ?> | |
| 106 | ||
| 107 | <div class="navlink previous"> Previous Event: <?php tribe_previous_event_link();?></div> | |
| 108 | ||
| 109 | <div class="navlink next"> Next Event: <?php tribe_next_event_link();?></div> | |
| 110 | <div style="clear:both"></div> |