• Resolved trint

    (@trint)


    Hello everybody,
    I’m looking for displaying past events in the list view as a one list with all year events without navigation.
    Here is my funtion to display all events and override extension post number choice.
    I tried with : ‘eventDisplay’ => ‘past’ but it doesn’t work.

    function modify_tribe_events_query( $wp_query ) {
        if( $wp_query->query_vars['post_type'] != 'tribe_events' ) return;
        $wp_query->query_vars['posts_per_page'] = -1;
    }
    add_filter( 'pre_get_posts', 'modify_tribe_events_query' );

    Any help is really appeciated.

    All the best

Viewing 1 replies (of 1 total)
  • Thread Starter trint

    (@trint)

    Hi,
    here is the snipet which works ;-).

    function tribe_set_default_date () {
    	if ((get_query_var("eventDisplay") == "default") && empty( $_REQUEST['tribe-bar-date'] ) ) {
    		$_REQUEST['tribe-bar-date'] = '2000-01-01';
    	}
    }
    add_action( 'parse_query', 'tribe_set_default_date' );
Viewing 1 replies (of 1 total)
  • The topic ‘Add past events to list view’ is closed to new replies.