Advertisement
BakerMan

TEC Single Template: Post Thumb as a Banner

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