Home › Forums › Calendar Products › Community Events › Hide recurring instances in community front end
- This topic has 13 replies, 3 voices, and was last updated 6 years, 3 months ago by Luke Kenny.
-
AuthorPosts
-
September 6, 2017 at 7:37 am #1345416Luke KennyParticipant
In the Community Events front end listing, is it possible to only show the next upcoming instance of a recurring event, rather than each individual instance? Similar to selecting “Show only the first instance of each recurring event (only affects list-style views).” but for the Community Events front end user.
I found a great snippet of code that works well for the back end events page, perhaps this could be altered?
`class Events_Admin_List__Remove_Child_Events {
public function __construct() {
// Don’t kick in unless we’re on the edit.php screen
add_action( ‘load-edit.php’, array( $this, ‘setup’ ) );
}
public function setup() {
// Listen out for the main events query
if ( ‘tribe_events’ === $GLOBALS[ ‘typenow’ ] )
add_action( ‘parse_query’, array( $this, ‘modify’ ) );
}
function modify( WP_Query $query ) {
// Run once, only for the main query
if ( ! $query->is_main_query() ) return;
remove_action( ‘parse_query’, array( $this, ‘modify’) );
// Only return top level posts as a means of ignoring child posts
$query->set( ‘post_parent’, 0 );
}
}
new Events_Admin_List__Remove_Child_Events;’September 7, 2017 at 11:09 am #1346188VictorKeymasterHi Luke!
Thanks for reaching out to us! Let me help you with this topic 🙂
First, please note that we are limited in how much we can support custom development questions like this.
That said, we always like helping out and at least point users into the right direction as much possible. We also have a list of customizers we’d like to share for this type of questions.
We will try to have a look at this and see if we can come up with a modified snippet that will accomplish what you are looking for. However, we are a bit busy at the moment so it may take us a day or more depending on the amount of work we have.
We’d appreciate your patience while we look into this. Do let us know if you have any questions in the meantime.
Thanks,
VictorSeptember 15, 2017 at 4:54 pm #1350046VictorKeymasterHi Luke,
I’m sorry for the delay in getting back to you.
I just wanted to check-in here to let you know that we haven’t been able to have a look at this yet, but we’ll probably have more time and resources next week.
I’ll keep you posted about it.
Best,
VictorOctober 4, 2017 at 6:05 pm #1359293VictorKeymasterHi Luke!
Just wanted to let you know that while working for a snippet to customize the community list view query, we’ve encountered a small bug that is not letting the snippet work and throwing an error.
We’ve logged a report about this error to be fixed in one of our next maintenance releases of our plugins and linked this thread to it.
We’ll let you know as soon as it’s fixed and also share the working snippet for you to try.
I’m sorry for the inconvenience and we’d appreciate your patience in the meantime.
Best,
VictorOctober 15, 2017 at 8:46 pm #1363999Luke KennyParticipantThanks Victor,
I really appreciate the ongoing updates.
Sounds like we’re close!
Luke
October 16, 2017 at 8:11 am #1364161VictorKeymasterSure thing Luke!
We’ll keep you posted.
Best,
VictorNovember 29, 2017 at 8:51 pm #1395463Luke KennyParticipantHi Victor,
Just wondering if there were any updates on this issue? Our customer is very clean to solve the problem of recurring events showing in the Community Events listings.
Luke
November 30, 2017 at 6:01 am #1395669VictorKeymasterHi Luke!
Thanks for following up with this!
I’ve just checked the report and a fix for the database error has been made and already passed QA.
We cannot commit to a date yet, but it is scheduled to be included in a maintenance release of The Events Calendar PRO in about two weeks.
We will notify you once it’s released and let you know the exact snippet that will achieve what you are looking for.
Best,
VictorDecember 19, 2017 at 12:21 pm #1409072CourtneyMemberHey there Luke
We’ve just released an update that should fix this bug. You can read more about it at http://m.tri.be/19tp. Please update your plugins and let us know if you are still experiencing this or if we can close out this ticket.
Note: We suggest testing updates on a staging server (https://theeventscalendar.com/knowledgebase/creating-using-wordpress-staging-site/).
Thanks
Courtney 🙂December 19, 2017 at 3:09 pm #1409248Luke KennyParticipantHi Courtney,
Victor mentioned above that a snippet to hide recurring instances in the community events view would be shared… are you able to please provide the snippet he is referring to?
December 22, 2017 at 4:44 pm #1412033VictorKeymasterHi Luke!
I’m sorry for the delay in getting back to you. I’ve been away for a few days.
Here’s the working snippet that should hide the recurring instances in the community events list:
add_filter( 'tribe_ce_my_events_query', function( $ce_list_query_args ) { $ce_list_query_args['tribeHideRecurrence'] = true; return $ce_list_query_args; } );
Please try it out and let me know if it works for you.
Best,
VictorDecember 28, 2017 at 11:53 pm #1414334Luke KennyParticipantSeems to work well, thanks for all your help.
December 29, 2017 at 4:37 am #1414393VictorKeymasterHappy to be of help here. Thanks for letting us know it works.
I’ll close this now but feel free to open a new topic if anything comes up and we’ll be happy to help.
Best,
Victor -
AuthorPosts
- The topic ‘Hide recurring instances in community front end’ is closed to new replies.