Abrams

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: List Upcoming and Past Events at /events #941546
    Abrams
    Participant

    I also found an issue with the search field unable to find past events. The only way it does is using the first ‘tribe_set_default_date’ action listed above. I have tested this on a custom theme and also WP 2011 theme with all plugins disabled.

    Example: Event has the word “Blue” in the title and using “blue” in the search field produces “no results found”. The only way it works is using the first ‘first tribe_set_default_date’ action listed above. By default, the search field should pull up past and future events correct?

    Also by default, even if I select the previous events link, and then search, it still says no results found.

    in reply to: List Upcoming and Past Events at /events #941542
    Abrams
    Participant

    Hi,
    Thank you for the response.

    I am trying to display all events (past/future) in the same list. I have tried the following examples, and a few others, but am unable to get results. I forgot to add I am using the filter bar as well.

    Tried this and variations of it, but it breaks/returns a page not found/404 for the single-event page.
    https://wordpress.org/support/topic/event-calendar-past-events-in-list-template

    // Set the default date for views like List and Month
    add_action( 'parse_query', 'tribe_set_default_date' );
    function tribe_set_default_date () {
    	if ( !is_single() && empty( $_REQUEST['tribe-bar-date'] ) ) {
    		$_REQUEST['tribe-bar-date'] = '2000-01-01';
    	}
    }
    

    Mtbhomer had the same issue with it breaking the single events page and came up with his own approach, but this will not work with the filter bar.

    // Set the default date for views like List and Month
    add_action( 'parse_query', 'tribe_set_default_date' );
    
    function tribe_set_default_date () {
    	if ((get_query_var("eventDisplay") == "default") && empty( $_REQUEST['tribe-bar-date'] ) ) {
    		$_REQUEST['tribe-bar-date'] = '2000-01-01';
    	}
    }

    Any guidance or solution would be greatly appreciated. Thank you.

Viewing 2 posts - 1 through 2 (of 2 total)