• Resolved mynym

    (@mynym)


    In order to sort past events with the latest event on top, I added this to my custom functions.php:

    function tribe_past_reverse_chronological ($post_object) {
    	$past_ajax = (defined( 'DOING_AJAX' ) && DOING_AJAX && $_REQUEST['tribe_event_display'] === 'past') ? true : false;
    	if(tribe_is_past() || $past_ajax) {
    		$post_object = array_reverse($post_object);
    	}
    	return $post_object;
    }
    add_filter('the_posts', 'tribe_past_reverse_chronological', 100);

    It works, unless I click on the “past events” (“Vorherige Veranstaltungen”) from the list of future events: In this case, all past events are sorted with the first on top. Only after reloading the page, the events appear in the correct order.

    You can check this behavior here:

    1. go to the list of current events:
    https://impact-akademie.com/veranstaltungen/list/?tribe_paged=1&tribe_event_display=list

    2. select “Vorherige Veranstaltungen”

    3. Please reload to see the order changing.

    Thanks for ideas on why this happens and how I can display past events in the right order on first loading the page.

Viewing 3 replies - 1 through 3 (of 3 total)
  • I am replying here because my issue is nearly identical. I have not adjusted my display order with a snippet, but when ‘next events’ are clicked they display in reverse order. After refreshing the screen, they show properly.

    Website
    https://shopsattheridge.com/upcoming-events

    Please click ‘next events’, look at the order and then refresh the page to see it display properly.

    Thank you for any assistance, I really enjoy the plugin overall!

    Barry

    (@barryhughes-1)

    Hi @mynym!

    If I’m not mistaken, this is a duplicate of this other topic recently created by you.

    Please avoid repeat posting where possible ??

    Thread Starter mynym

    (@mynym)

    Hi Barry, my mistake, I had to correct my post and ended up creating an (almost identical) copy… I will continue in the thread you answered (https://www.ads-software.com/support/topic/right-order-of-past-events-only-after-reload/).

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘right order of past events only after reload’ is closed to new replies.