Home › Forums › Calendar Products › Events Calendar PRO › Hide past events from single event navigation
- This topic has 3 replies, 2 voices, and was last updated 7 years, 7 months ago by
Andras.
-
AuthorPosts
-
September 7, 2018 at 9:38 am #1616417
Ian
ParticipantIs it possible to hide past events from the <<previous event title next event title>> navigation which appears on event pages?
If not is it the case still that the only way tor remove this navigation is by editing the single post template file at /wp-content/plugins/the-events-calendar/src/views/single-event.php and placing the edited version in a theme folder?
Is it OK to have the path to a custom edited version like this:
/wp-content/themes/themify-ultra-child/tribe-events/list/single-event.php
Or should the edited copy sit in the main /tribe-events/ folder?September 10, 2018 at 4:33 am #1617400Andras
KeymasterHi Ian,
If you want to hid that link from all single event pages, even the future ones (you are on a page for Oct. 12, and you want to hide the link to Oct. 11), you can do that via CSS.
Otherwise it should possible with a customization through a template override, just like you mentioned.
The best is to have that file in the child theme’s folder, like you have it:
/wp-content/themes/themify-ultra-child/tribe-events/list/single-event.php
If you put it in the main / parent theme folder, then it will likely get lost with a theme update.
For the customization, you actually might be able to tap into this filter:
apply_filters( 'tribe_get_prev_event_link', tribe( 'tec.adjacent-events' )->get_prev_event_link( $anchor ), $event_id );and check if it’s a past event. If it is, then return an empty string.
Does this help?
A.
September 10, 2018 at 4:41 am #1617406Ian
ParticipantThanks for your reply.
You suggest I could tap into a filter
apply_filters( 'tribe_get_prev_event_link', tribe( 'tec.adjacent-events' )->get_prev_event_link( $anchor ), $event_id );and then; ‘check if it’s a past event’… Would you be able to suggest how this last part might be achieved?
Thanks
September 11, 2018 at 3:30 am #1618300Andras
KeymasterHi Ian,
Best I could do on short notice is the following.
It will still show you the url to the first event in the past, but later (or rather earlier) it will not show it any more.
Copy this to your (child) theme’s functions.php file and let me know if this does the trick for you:
[code language=”php”]
add_filter( ‘tribe_get_prev_event_link’, ‘my_custom_prev_event_link’, 10, 2 );
function my_custom_prev_event_link( $anchor, $event_id ) {
if ( ! tribe_is_past_event () ) {
return $anchor;
}
}[/code]Please note that this essentially is a custom development task and so is outside of our stated scope of support. We may be able to assist you further. We do need to prioritize support requests from other customers at this time but I’ll certainly flag this with the team and – although we can’t make any promises – if we have time and space to come back and help, we’ll be happy to do so. Please let us know if you’d like to go this route so that you can be added to this queue.
In the meantime, if there is any more information you can share (including mocks) that will help us to better understand what you are seeking please do feel free to add them to this ticket.
If you urgently need help with this, however, you may instead wish to consider working with a suitably skilled developer or designer who can offer the additional level of support you require.
Cheers,
AndrasOctober 3, 2018 at 9:35 am #1636401Support 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 ‘Hide past events from single event navigation’ is closed to new replies.
