Home › Forums › Calendar Products › Events Calendar PRO › Remove year from function tribe_events_list_the_date_headers()
- This topic has 3 replies, 2 voices, and was last updated 8 years, 3 months ago by
oxygengraphics.
-
AuthorPosts
-
January 23, 2018 at 3:14 am #1433315
oxygengraphics
ParticipantI’m trying to customise the events pro calendar and understand that I can’t edit the files within /template-tags directly.
I’m hoping if you can help me with this I should be able to do further customisations.
Below is the function I want to modify and I simply want to remove the year from coming out of the header.
What would I put into my functions.php in order to do this?
function tribe_events_list_the_date_headers() {
/* Month and year separators (on every month and year change) */ $show_headers = apply_filters( 'tribe_events_list_show_date_headers', true ); $html = ''; if ( $show_headers ) { global $post, $wp_query; $event_year = tribe_get_start_date( $post, false, 'Y' ); $event_month = tribe_get_start_date( $post, false, 'm' ); $month_year_format = tribe_get_date_option( 'monthAndYearFormat', 'F Y' ); if ( $wp_query->current_post > 0 ) { $prev_post = $wp_query->posts[ $wp_query->current_post - 1 ]; $prev_event_year = tribe_get_start_date( $prev_post, false, 'Y' ); $prev_event_month = tribe_get_start_date( $prev_post, false, 'm' ); } /* * If the event month changed since the last event in the loop, * or is the same month but the year changed. * */ if ( $wp_query->current_post === 0 || ( $prev_event_month != $event_month || ( $prev_event_month == $event_month && $prev_event_year != $event_year ) ) ) { $html .= sprintf( "<span class='tribe-events-list-separator-month'><span>%s</span></span>", tribe_get_start_date( $post, false, $month_year_format ) ); } echo apply_filters( 'tribe_events_list_the_date_headers', $html, $event_year ); } }January 23, 2018 at 9:26 pm #1434313Cliff
MemberHi. Are you wanting to hide the Year sitewide or only within these headers?
February 14, 2018 at 8:37 am #1453076Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Remove year from function tribe_events_list_the_date_headers()’ is closed to new replies.
