have_posts() ) { if ( $wp_query->get( 'paged' ) > 1 ) { // if we're on page 1, show the selected tribe-bar-date as the first date in the range $first_event_date = tribe_get_start_date( $wp_query->posts[0], false ); } else { //otherwise show the start date of the first event in the results $first_event_date = tribe_format_date( $_REQUEST['tribe-bar-date'], false ); } $last_event_date = tribe_get_end_date( $wp_query->posts[ count( $wp_query->posts ) - 1 ], false ); $title = sprintf( $title_range, $first_event_date, $last_event_date ); } elseif ( tribe_is_past() ) { $title = $title_past; } // Month view title if ( tribe_is_month() ) { $title = sprintf( $title_month, date_i18n( tribe_get_option( 'monthAndYearFormat', 'F Y' ), strtotime( tribe_get_month_view_date() ) ) ); } // Day view title if ( tribe_is_day() ) { $title = sprintf( $title_day, date_i18n( tribe_get_date_format( true ), strtotime( $wp_query->get( 'start_date' ) ) ) ); } // All recurrences of an event if ( function_exists('tribe_is_showing_all') && tribe_is_showing_all() ) { $title = sprintf( $title_all, get_the_title() ); } // Week view title if ( function_exists('tribe_is_week') && tribe_is_week() ) { $title = sprintf( $title_week, date_i18n( $date_format, strtotime( tribe_get_first_week_day( $wp_query->get( 'start_date' ) ) ) ) ); } if ( is_tax( $tribe_ecp->get_event_taxonomy() ) && $depth ) { $cat = get_queried_object(); $title = '' . $title . ''; $title .= ' › ' . $cat->name; } return $title; } add_filter( 'tribe_get_events_title', 'tribe_alter_event_archive_titles', 11, 2 );