Advertisement
BakerMan

Alternative list.php time/date meta layout

Apr 18th, 2013
373
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.94 KB | None | 0 0
  1. <?php
  2. // Get the start date and end date
  3. $date_output = tribe_get_start_date(null, false);
  4. $end_date = tribe_get_end_date(null, false);
  5.  
  6. // Only show the end date if it is different to the start date
  7. if ($date_output !== $end_date) $date_output .= " &ndash; $end_date";
  8.  
  9. // If it is an all day event then say so
  10. if (tribe_get_all_day()) $time_output = '(All day event)';
  11.  
  12. // Otherwise show the start-end times
  13. else $time_output = tribe_get_start_date(null, false, get_option('time_format')).' &ndash; '
  14.     .tribe_get_end_date(null, false, get_option('time_format'));
  15. ?>
  16. <tr>
  17.     <td class="tribe-events-event-meta-desc"><?php _e('Date:', 'tribe-events-calendar') ?></td>
  18.     <td class="tribe-events-event-meta-value"><?php esc_html_e($date_output) ?></td>
  19. </tr>
  20. <tr>
  21.     <td class="tribe-events-event-meta-desc"><?php _e('Time:', 'tribe-events-calendar') ?></td>
  22.     <td class="tribe-events-event-meta-value"><?php esc_html_e($time_output) ?></td>
  23. </tr>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement