Help Desk

Is it possible to display past events on the user's list of events?

  • Posts: 47 Topics: 32
    | Permalink

    The default behavior is to just display future events but I was wondering if it is possible to display past events that the user has created on the user’s Community Events list page?

    Posts: 18146 Topics: 17 Answers: 973
    | Permalink

    Hi – great question!

    The query arguments used to build that list are filterable via the tribe_ce_my_events_query hook – so something like this (which you could add to your theme’s functions.php file) should work:

    add_filter( 'tribe_ce_my_events_query', 'alter_community_my_events_list' );
    
    function alter_community_my_events_list( $args ) {
        $args['eventDisplay'] = 'custom';
        $args['start_date'] = '2000-01-01';
        $args['end_date'] = '2100-01-01';
        return $args;
    }

    Does that help?

    Posts: 47 Topics: 32
    | Permalink

    Is it possible to have a separate page with just past events? Something like ‘/events/community/past/’?

    If not, what would be the best way to visually display them in a separate list?

    Posts: 18146 Topics: 17 Answers: 973
    | Permalink

    That’s really the sort of custom dev question we need to leave to you to solve 🙂

    All sorts of things are possible, even if they are not facilitated “out of the box” – and though we are always open to new feature requests if you need to push ahead with something like this in the short term it’s really something you’d need to work through on your own (albeit, if you have any further specific questions and we can push you in the right direction we’ll be happy to do so).

    Posts: 47 Topics: 32
    | Permalink

    Is there a tutorial somewhere on registering a new template and a new URL endpoint?

    Posts: 18146 Topics: 17 Answers: 973
    | Permalink

    None that are specific to our suite of plugins, that I know of, but there should be a number of resources on the wider web relating to registering routes/endpoints on one hand and hooking in new templates.

    Really though that’s a matter of general WP development – and is sufficiently advanced that it’s not something we can assist with here, I’m afraid.

    With that in mind I’ll go ahead and close this thread, but I do wish you luck and if any other questions crop up along the way certainly feel free to create new threads to ask us about them and if we can point you in the right direction we will 🙂