Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.66 KB | None | 0 0
  1. <?php
  2. /**
  3. * List View Single Event
  4. * This file contains one event in the list view
  5. *
  6. * This override will add the organizer(s) after the event information
  7. *
  8. * Place this template file in your own theme / child theme by creating a file at:
  9. * [your-theme]/tribe-events/list/single-event.php
  10. *
  11. * @version 4.6.19
  12. *
  13. */
  14. if ( ! defined( 'ABSPATH' ) ) {
  15. die( '-1' );
  16. }
  17.  
  18. // Setup an array of venue details for use later in the template
  19. $venue_details = tribe_get_venue_details();
  20.  
  21. // The address string via tribe_get_venue_details will often be populated even when there's
  22. // no address, so let's get the address string on its own for a couple of checks below.
  23. $venue_address = tribe_get_address();
  24.  
  25. // Venue
  26. $has_venue_address = ( ! empty( $venue_details['address'] ) ) ? ' location' : '';
  27.  
  28. // Organizer
  29. $organizer_ids = tribe_get_organizer_ids();
  30. $multiple = count( $organizer_ids ) > 1;
  31. //$organizer = tribe_get_organizer();
  32.  
  33. ?>
  34.  
  35. <!-- Event Title -->
  36. <?php do_action( 'tribe_events_before_the_event_title' ) ?>
  37. <h3 class="tribe-events-list-event-title">
  38. <a class="tribe-event-url" href="<?php echo esc_url( tribe_get_event_link() ); ?>" title="<?php the_title_attribute() ?>" rel="bookmark">
  39. <?php the_title() ?>
  40. </a>
  41. </h3>
  42. <?php do_action( 'tribe_events_after_the_event_title' ) ?>
  43.  
  44. <!-- Event Meta -->
  45. <?php do_action( 'tribe_events_before_the_meta' ) ?>
  46. <div class="tribe-events-event-meta">
  47. <div class="author <?php echo esc_attr( $has_venue_address ); ?>">
  48.  
  49. <!-- Schedule & Recurrence Details -->
  50. <div class="tribe-event-schedule-details">
  51. <?php echo tribe_events_event_schedule_details() ?>
  52. </div>
  53.  
  54. <?php if ( $venue_details ) : ?>
  55. <!-- Venue Display Info -->
  56. <div class="tribe-events-venue-details">
  57. <?php
  58. $address_delimiter = empty( $venue_address ) ? ' ' : ', ';
  59.  
  60. // These details are already escaped in various ways earlier in the process.
  61. echo implode( $address_delimiter, $venue_details );
  62.  
  63. if ( tribe_show_google_map_link() ) {
  64. echo tribe_get_map_link_html();
  65. }
  66. ?>
  67. </div> <!-- .tribe-events-venue-details -->
  68.  
  69. <!-- Organizer Display Info -->
  70. <? if ( ! empty ( $organizer_ids ) ) : ?>
  71. <div class="tribe-events-organizer-details">
  72. <?php echo $multiple > 0 ? "Organizers: " : "Organizer: "; ?>
  73. <?php
  74. $count = 0;
  75. foreach ( $organizer_ids as $organizer ) {
  76. if ( ! $organizer ) {
  77. continue;
  78. }
  79. echo tribe_get_organizer_link( $organizer );
  80. $count++;
  81. if ( $multiple && $count < count( $organizer_ids ) ) {
  82. echo ', ';
  83. }
  84. } // end foreach ?>
  85. <?php endif; ?>
  86. </div> <!-- .tribe-events-organizer-details -->
  87. <?php endif; ?>
  88.  
  89. </div>
  90. </div><!-- .tribe-events-event-meta -->
  91.  
  92. <!-- Event Cost -->
  93. <?php if ( tribe_get_cost() ) : ?>
  94. <div class="tribe-events-event-cost">
  95. <span class="ticket-cost"><?php echo tribe_get_cost( null, true ); ?></span>
  96. <?php
  97. /**
  98. * Runs after cost is displayed in list style views
  99. *
  100. * @since 4.5
  101. */
  102. do_action( 'tribe_events_inside_cost' )
  103. ?>
  104. </div>
  105. <?php endif; ?>
  106.  
  107. <?php do_action( 'tribe_events_after_the_meta' ) ?>
  108.  
  109. <!-- Event Image -->
  110. <?php echo tribe_event_featured_image( null, 'medium' ); ?>
  111.  
  112. <!-- Event Content -->
  113. <?php do_action( 'tribe_events_before_the_content' ); ?>
  114. <div class="tribe-events-list-event-description tribe-events-content description entry-summary">
  115. <?php echo tribe_events_get_the_excerpt( null, wp_kses_allowed_html( 'post' ) ); ?>
  116. <a href="<?php echo esc_url( tribe_get_event_link() ); ?>" class="tribe-events-read-more" rel="bookmark"><?php esc_html_e( 'Find out more', 'the-events-calendar' ) ?> &raquo;</a>
  117. </div><!-- .tribe-events-list-event-description -->
  118. <?php
  119. do_action( 'tribe_events_after_the_content' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement