Advertisement
BakerMan

List widget (TEC 3.0) with event end dates removed

Jul 8th, 2013
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.36 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Customized list widget template, which does *not* display event end dates.
  4.  */
  5.  
  6. if ( !defined('ABSPATH') ) { die('-1'); } ?>
  7.  
  8. <li>
  9.     <h4 class="entry-title summary">
  10.             <a href="<?php echo tribe_get_event_link(); ?>" rel="bookmark"><?php the_title(); ?></a>
  11.     </h4>
  12.     <div class="duration">
  13.         <?php
  14.         $event_date = tribe_events_event_schedule_details();
  15.  
  16.         // Try to detect if the end time is present - this may fail if for example a filter runs on
  17.         // tribe_events_event_schedule_details and does something funky
  18.         $end_segment = strpos($event_date, '<span class="end-time');
  19.  
  20.         // We'll come back 2 chars from the position of the end date/time span (to catch the separator symbol, normally
  21.         // a hyphen. Again this may need adjustment to accommodate related customizations
  22.         if (false !== $end_segment) $event_date = substr($event_date, 0, $end_segment - 2);
  23.  
  24.         echo $event_date;
  25.         ?>
  26.     </div>
  27.     <?php if ( $cost && tribe_get_cost() != '' ) { ?>
  28.         <span class="tribe-events-divider">|</span>
  29.         <div class="tribe-events-event-cost">
  30.             <?php echo tribe_get_cost( null, true ); ?>
  31.         </div>
  32.     <?php } ?>         
  33.     <div class="vcard adr location">   
  34.  
  35.         <?php if ( $venue  && tribe_get_venue() != '') { ?>
  36.             <span class="fn org tribe-venue"><?php echo tribe_get_venue_link(); ?></span>
  37.         <?php } ?>
  38.  
  39.         <?php if ( $address && tribe_get_address() != '' ) { ?>
  40.             <span class="street-address"><?php echo tribe_get_address(); ?></span>
  41.         <?php } ?>
  42.  
  43.         <?php if ( $city && tribe_get_city() != '' ) { ?>
  44.             <span class="locality"><?php echo tribe_get_city(); ?></span>
  45.         <?php } ?>
  46.  
  47.         <?php if ( $region && tribe_get_region() !='' ) { ?>
  48.             <span class="region"><?php echo tribe_get_region(); ?></span>
  49.         <?php   } ?>
  50.  
  51.         <?php if ( $zip && tribe_get_zip() != '' ) { ?>
  52.             <span class="postal-code"><?php echo tribe_get_zip(); ?></span>
  53.         <?php } ?>
  54.  
  55.         <?php if ( $country  && tribe_get_country() != '') { ?>
  56.             <span class="country-name"><?php echo tribe_get_country(); ?></span>
  57.         <?php } ?>
  58.  
  59.         <?php if ( $organizer && tribe_get_organizer() != '' ) { ?>
  60.         <?php _e( 'Organizer:', 'tribe-events-calendar-pro' ); ?>
  61.                 <span class="tribe-organizer"><?php echo tribe_get_organizer_link(); ?></span>
  62.         <?php } ?>
  63.  
  64.         <?php if ( $phone && tribe_get_phone() != '' ) { ?>
  65.             <span class="tel"><?php echo tribe_get_phone(); ?></span>
  66.         <?php } ?>
  67.     </div>
  68. </li>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement