Home › Forums › Calendar Products › Events Calendar PRO › Change order of events
- This topic has 5 replies, 4 voices, and was last updated 7 years, 1 month ago by Mario.
-
AuthorPosts
-
February 26, 2017 at 12:15 pm #1246055MarioParticipant
Hello
I would like to change the order of my events. http://vfg.ch/agenda-2/
Is it possible to display the newest / latest events first? Just the opposite as it is right now.Best regards and thanks
MarioFebruary 28, 2017 at 10:23 am #1247094CourtneyMemberHi Mario
To change the sorting order to descending, you’ll need to add the following code to site.
https://gist.github.com/geoffgraham/39d59bf67175e9b93bda
You can add this to your child theme‘s functions.php file, or with a plugin.
Please let me know if this helps.
Thanks! 🙂
Courtney
February 28, 2017 at 10:56 am #1247113MarioParticipantHello Courtney
It works, but unfortunately only in the list view. It doesn’t work in the photo view (http://vfg.ch/agenda-2/?tribe_event_display=photo)
Do you have a code for this display setting as well?Many thanks in advance
MarioMarch 1, 2017 at 7:11 am #1247596CourtneyMemberTry this instead:
// Changes listed event views to reverse chronological order
function tribe_past_reverse_chronological ($post_object) {
$past_ajax = (defined( 'DOING_AJAX' ) && DOING_AJAX && $_REQUEST['tribe_event_display'] === 'upcoming') ? true : false;
if(tribe_is_past() || tribe_is_photo() || tribe_is_upcoming() || $past_ajax) {
$post_object = array_reverse($post_object);
}
return $post_object;
}
add_filter('the_posts', 'tribe_past_reverse_chronological', 100);
And let me know how it goes.
Thanks again
CourtneyMarch 23, 2017 at 9:35 am #1258731Support DroidKeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Change order of events’ is closed to new replies.