Last active
October 5, 2022 16:20
-
-
Save cliffordp/69e9440d344e923c8f326b7ed846b04f to your computer and use it in GitHub Desktop.
Custom PHOTO VIEW to add Organizer and Venue details. -- Place in this location: /wp-content/themes/YOUR_THEME_DIRECTORY/tribe-events/pro/photo/single-event.php -- and delete whatever you do not need or want -- A GIF preview of the result: http://cl.ly/0R2r0Q0F0L03
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Photo View Single Event | |
* This file contains one event in the photo view | |
* | |
* @package TribeEventsCalendar | |
* | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { | |
die( '-1' ); | |
} ?> | |
<?php | |
global $post; | |
?> | |
<div class="tribe-events-photo-event-wrap"> | |
<?php echo tribe_event_featured_image( null, 'medium' ); ?> | |
<div class="tribe-events-event-details tribe-clearfix"> | |
<!-- Event Title --> | |
<?php do_action( 'tribe_events_before_the_event_title' ); ?> | |
<h2 class="tribe-events-list-event-title"> | |
<a class="tribe-event-url" href="<?php echo esc_url( tribe_get_event_link() ); ?>" title="<?php the_title() ?>" rel="bookmark"> | |
<?php the_title(); ?> | |
</a> | |
</h2> | |
<?php do_action( 'tribe_events_after_the_event_title' ); ?> | |
<!-- Event Meta --> | |
<?php do_action( 'tribe_events_before_the_meta' ); ?> | |
<div class="tribe-events-event-meta"> | |
<div class="tribe-event-schedule-details"> | |
<?php if ( ! empty( $post->distance ) ) : ?> | |
<strong>[<?php echo tribe_get_distance_with_unit( $post->distance ); ?>]</strong> | |
<?php endif; ?> | |
<?php echo tribe_events_event_schedule_details(); ?> | |
<?php | |
// START ORGANIZER AND VENUE ADDITIONS | |
// MOSTLY COPIED FROM /wp-content/plugins/the-events-calendar/src/views/modules/meta/... | |
// START ORGANIZER | |
// Include organizer meta if appropriate | |
if ( tribe_has_organizer() ) { | |
$organizer_ids = tribe_get_organizer_ids(); | |
$multiple = count( $organizer_ids ) > 1; | |
$phone = tribe_get_organizer_phone(); | |
$email = tribe_get_organizer_email(); | |
$website = tribe_get_organizer_website_link(); | |
?> | |
<div class="tribe-events-meta-group-organizer"> | |
<h3 class="tribe-events-single-section-title"><?php echo tribe_get_organizer_label( ! $multiple ); ?></h3> | |
<dl> | |
<?php | |
foreach ( $organizer_ids as $organizer ) { | |
if ( ! $organizer ) { | |
continue; | |
} | |
?> | |
<dt style="display:none;"><?php // This element is just to make sure we have a valid HTML ?></dt> | |
<dd class="tribe-organizer"> | |
<?php echo tribe_get_organizer_link( $organizer ) ?> | |
</dd> | |
<?php | |
} | |
if ( ! $multiple ) { // only show organizer details if there is one | |
if ( ! empty( $phone ) ) { | |
?> | |
<dt> | |
<?php esc_html_e( 'Phone:', 'the-events-calendar' ) ?> | |
</dt> | |
<dd class="tribe-organizer-tel"> | |
<?php echo esc_html( $phone ); ?> | |
</dd> | |
<?php | |
}//end if | |
if ( ! empty( $email ) ) { | |
?> | |
<dt> | |
<?php esc_html_e( 'Email:', 'the-events-calendar' ) ?> | |
</dt> | |
<dd class="tribe-organizer-email"> | |
<?php echo esc_html( $email ); ?> | |
</dd> | |
<?php | |
}//end if | |
if ( ! empty( $website ) ) { | |
?> | |
<dt> | |
<?php esc_html_e( 'Website:', 'the-events-calendar' ) ?> | |
</dt> | |
<dd class="tribe-organizer-url"> | |
<?php echo $website; ?> | |
</dd> | |
<?php | |
}//end if | |
}//end if | |
?> | |
</dl> | |
</div> | |
<?php | |
} | |
// END ORGANIZER | |
// ADD VENUE | |
if ( ! empty( tribe_get_venue_id() ) ) { // open IF VENUE | |
$phone = tribe_get_phone(); | |
$website = tribe_get_venue_website_link(); | |
?> | |
<div class="tribe-events-meta-group-venue"> | |
<h3 class="tribe-events-single-section-title"> <?php esc_html_e( tribe_get_venue_label_singular(), 'the-events-calendar' ) ?> </h3> | |
<dl> | |
<dd class="tribe-venue"> <?php echo tribe_get_venue() ?> </dd> | |
<?php if ( tribe_address_exists() ) : ?> | |
<dd class="tribe-venue-location"> | |
<address class="tribe-events-address"> | |
<?php echo tribe_get_full_address(); ?> | |
<?php if ( tribe_show_google_map_link() ) : ?> | |
<?php echo tribe_get_map_link_html(); ?> | |
<?php endif; ?> | |
</address> | |
</dd> | |
<?php endif; ?> | |
<?php if ( ! empty( $phone ) ): ?> | |
<dt> <?php esc_html_e( 'Phone:', 'the-events-calendar' ) ?> </dt> | |
<dd class="tribe-venue-tel"> <?php echo $phone ?> </dd> | |
<?php endif ?> | |
<?php if ( ! empty( $website ) ): ?> | |
<dt> <?php esc_html_e( 'Website:', 'the-events-calendar' ) ?> </dt> | |
<dd class="url"> <?php echo $website ?> </dd> | |
<?php endif ?> | |
</dl> | |
</div> | |
<?php | |
} // close IF VENUE | |
// END VENUE | |
?> | |
</div> | |
</div><!-- .tribe-events-event-meta --> | |
<?php do_action( 'tribe_events_after_the_meta' ); ?> | |
<!-- Event Content --> | |
<?php do_action( 'tribe_events_before_the_content' ); ?> | |
<div class="tribe-events-list-photo-description tribe-events-content"> | |
<?php echo tribe_events_get_the_excerpt() ?> | |
</div> | |
<?php do_action( 'tribe_events_after_the_content' ) ?> | |
</div><!-- /.tribe-events-event-details --> | |
</div><!-- /.tribe-events-photo-event-wrap --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment