I would like to add a custom field to events to define if they are on a single day or multiple days. I would then like to modify the query that displays all the events to change the sort order.
Where do I find the query that lists the events (I believe it sorts them now by starting date), so that I can modify it?
Thanks for reaching out! You can find the main query at wp-content/plugins/the-events-calendar/src/Tribe/Query.php.
Adding a custom field to events will require a bit of a customization – I would recommend taking a look at our themer’s guide as a starting point. You may also want to look into the custom fields that come with Events Calendar Pro, which could save you some serious development time if they will do what you need!
If you get stuck or have any questions, please let me know!
I have Events Calendar Pro but it looks like ‘custom fields’ is just for collecting additional data for the actual event. What I’d like to do is basically sort the results by date descending, (multi day) asc. Right now if an event goes on for 5 months, it always shows on top which is not ideal.
Thanks for clarifying! Good news – in this case, you should not need to add a custom field, but instead you can use the tribe_event_is_multiday function to check for multi-day events, then you can use the result to sort accordingly.
Hey 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
Author
Posts
Viewing 5 posts - 1 through 5 (of 5 total)
The topic ‘Modifying the events list query’ is closed to new replies.