Conditionally remove start / end time if all day event
-
How can I add conditional code so that start and end times are removed if the event is an all day one?
I’m also wondering how to conditionally show the start and end date for events that start on one day and end on a different one (ie 2+ Day events).
This is the format I am adding the times currently:
add_action( 'tribe_events_after_loop', 'add_past_events' ); function add_past_events() { if ( ! tribe_is_list_view() || ! tribe_is_upcoming() ) return; remove_action( 'tribe_events_after_loop', 'add_past_events' ); $past_events = tribe_get_events( array( 'eventDisplay' => 'past' ) ); foreach ( $past_events as $event ) echo do_shortcode( "$event->post_title" . tribe_get_start_date( $event->ID, true, 'l, F j, Y') . tribe_get_start_date( $event->ID, true, 'g:i a') . ' to ' . tribe_get_end_date( $event->ID, true, 'g:i a') ); }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Conditionally remove start / end time if all day event’ is closed to new replies.