Help Desk

Hide recurring instances in community front end

  • Posts: 14 Topics: 17
    | Permalink

    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;’

    Posts: 3271 Topics: 4
    | Permalink

    Hi 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,
    Victor

    Posts: 3271 Topics: 4
    | Permalink

    Hi 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,
    Victor

    Posts: 3271 Topics: 4
    | Permalink

    Hi 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,
    Victor

    Posts: 14 Topics: 17
    | Permalink

    Thanks Victor,

    I really appreciate the ongoing updates.

    Sounds like we’re close!

    Luke

    Posts: 3271 Topics: 4
    | Permalink

    Sure thing Luke!

    We’ll keep you posted.

    Best,
    Victor

    Posts: 14 Topics: 17
    | Permalink

    Hi 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

    Posts: 3271 Topics: 4
    | Permalink

    Hi 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,
    Victor

    Posts: 3545
    | Permalink

    Hey 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 🙂

    Posts: 14 Topics: 17
    | Permalink

    Hi 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?

    Posts: 3271 Topics: 4
    | Permalink

    Hi 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,
    Victor

    Posts: 14 Topics: 17
    | Permalink

    Seems to work well, thanks for all your help.

    Posts: 3271 Topics: 4
    | Permalink

    Happy 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

    | Permalink

The topic ‘Hide recurring instances in community front end’ is closed to new replies.