I am using a plugin called "The Events Calendar" to organize events. By default, it orders them chronologically but I want to do it in reverse. I found the PHP code that should be placed in functions.php but when placing the page bursts, in a few words. It does not charge or do anything. Do you know what happens?
<?php
// Changes past event views to reverse chronological order
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);