Changing The Event Order
-
Hi,
So, I’m using the Events Calendar and I’d like to add a custom order to my events.‘The client doesn’t want them ordered by date, but instead would like to use a “menu_order” param. This is because they have 4 events they want displayed in a set order.
So I’ve added the “menu_order” page attribute to the tribe_event post type without issue by using the ‘register_post_type_args’ filter. But when it comes to displaying the events in this order I’m having a lot of difficulty.
I’ve tried using both ‘pre_get_posts’ & ‘tribe_events_archive_get_args’ filters, but neither seem to change the ordering at all.
Weirdly if i use the pre_get_posts filter, if i add some debugging to the get_view_html() function (to show var_dump($query->posts)); They actually appear to be in the correct order, but by the time the template file is loaded they have changed back to date order.
The only view i need to display is the list view ([your-theme]/tribe/events/v2/list.php), all other views have been removed from displaying.
Can you please help me out, it shouldn’t be so difficult to change some of the query args passed into the template file.Thanks
-
Hi @kurtnuimage
Thanks for getting in touch, I would be happy to point you in the right direction.
Your desired use-case scenario may be possible with some custom coding, but if you decide to give that a try, please note we cannot provide full support for custom implementations like that.
A good place to start would be our Themer’s Guide, if you’re comfortable doing it DIY. https://theeventscalendar.com/knowledgebase/guide/customization/
In the meantime, I will inquire with the team to determine whether the order can be modified easily. I will provide you with an update as soon as I gather more information.
- You must be logged in to reply to this topic.