Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Single Event Template
- * A single event. This displays the event title, description, meta, and
- * optionally, the Google map for the event.
- *
- * Override this template in your own theme by creating a file at [your-theme]/tribe-events/single-event.php
- *
- * @package TribeEventsCalendar
- * @since 2.1
- * @author Modern Tribe Inc.
- *
- */
- if ( !defined('ABSPATH') ) { die('-1'); }
- $event_id = get_the_ID();
- ?>
- <div id="tribe-events-content" class="tribe-events-single">
- <p class="tribe-events-back"><a href="<?php echo tribe_get_events_link() ?>"> <?php _e( '« All Events', 'tribe-events-calendar' ) ?></a></p>
- <!-- Notices -->
- <?php tribe_events_the_notices() ?>
- <?php the_title( '<h2 class="tribe-events-single-event-title summary">', '</h2>' ); ?>
- <div class="tribe-events-schedule updated published tribe-clearfix">
- <h3><?php echo tribe_events_event_schedule_details(); ?></h3>
- <?php echo tribe_events_event_recurring_info_tooltip(); ?>
- <?php if ( tribe_get_cost() ) : ?>
- <span class="tribe-events-divider">|</span>
- <span class="tribe-events-cost"><?php echo tribe_get_cost( null, true ) ?></span>
- <?php endif; ?>
- </div>
- <!-- Event header -->
- <div id="tribe-events-header" <?php tribe_events_the_header_attributes() ?>>
- <!-- Navigation -->
- <h3 class="tribe-events-visuallyhidden"><?php _e( 'Event Navigation', 'tribe-events-calendar' ) ?></h3>
- <ul class="tribe-events-sub-nav">
- <li class="tribe-events-nav-previous"><?php tribe_the_prev_event_link( '« %title%' ) ?></li>
- <li class="tribe-events-nav-next"><?php tribe_the_next_event_link( '%title% »' ) ?></li>
- </ul><!-- .tribe-events-sub-nav -->
- </div><!-- #tribe-events-header -->
- <?php while ( have_posts() ) : the_post(); ?>
- <div id="post-<?php the_ID(); ?>" <?php post_class('vevent'); ?>>
- <!-- Event featured image -->
- <?php echo tribe_event_featured_image(); ?>
- <!-- Event content -->
- <?php do_action( 'tribe_events_single_event_before_the_content' ) ?>
- <div class="tribe-events-single-event-description tribe-events-content entry-content description">
- <?php the_content(); ?>
- </div><!-- .tribe-events-single-event-description -->
- <?php do_action( 'tribe_events_single_event_after_the_content' ) ?>
- <!-- Event meta -->
- <?php
- $event_id = get_the_ID();
- $group_venue = apply_filters( 'tribe_events_single_event_the_meta_group_venue', false, $event_id );
- $html = '';
- $html .= '<div class="tribe-events-single-section tribe-events-event-meta tribe-clearfix">';
- // Event Details
- $html .= tribe_get_meta_group( 'tribe_event_details' );
- // When there is no map show the venue info up top
- if ( ! $group_venue && ! tribe_embed_google_map( $event_id ) ) {
- // Venue Details
- $html .= tribe_get_meta_group( 'tribe_event_venue' );
- $group_venue = false;
- } else if ( ! $group_venue && ! tribe_has_organizer( $event_id ) && tribe_address_exists( $event_id ) && tribe_embed_google_map( $event_id ) ) {
- $html .= sprintf( '%s<div class="tribe-events-meta-group tribe-events-meta-group-gmap">%s</div>',
- tribe_get_meta_group( 'tribe_event_venue' ),
- tribe_get_meta( 'tribe_venue_map' )
- );
- $group_venue = false;
- } else {
- $group_venue = true;
- }
- // Organizer Details
- if ( tribe_has_organizer( $event_id ) ) {
- $html .= tribe_get_meta_group( 'tribe_event_organizer' );
- }
- //$html .= apply_filters( 'tribe_events_single_event_the_meta_addon', '', $event_id );
- $html .= '</div>';
- if ( $group_venue ) {
- // If there's a venue map and custom fields or organizer, show venue details in this seperate section
- $venue_details = tribe_get_meta_group( 'tribe_event_venue' ) .
- tribe_get_meta( 'tribe_venue_map' );
- if ( !empty($venue_details) ) {
- $html .= apply_filters( 'tribe_events_single_event_the_meta_venue_row', sprintf( '<div class="tribe-events-single-section tribe-events-event-meta tribe-clearfix">%s</div>',
- $venue_details
- ) );
- }
- }
- echo $html;
- ?>
- </div><!-- .hentry .vevent -->
- <?php if( get_post_type() == TribeEvents::POSTTYPE && tribe_get_option( 'showComments','no' ) == 'yes' ) { comments_template(); } ?>
- <?php endwhile; ?>
- <!-- Event footer -->
- <div id="tribe-events-footer">
- <!-- Navigation -->
- <!-- Navigation -->
- <h3 class="tribe-events-visuallyhidden"><?php _e( 'Event Navigation', 'tribe-events-calendar' ) ?></h3>
- <ul class="tribe-events-sub-nav">
- <li class="tribe-events-nav-previous"><?php tribe_the_prev_event_link( '« %title%' ) ?></li>
- <li class="tribe-events-nav-next"><?php tribe_the_next_event_link( '%title% »' ) ?></li>
- </ul><!-- .tribe-events-sub-nav -->
- </div><!-- #tribe-events-footer -->
- </div><!-- #tribe-events-content -->
Advertisement
Add Comment
Please, Sign In to add comment