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
- You must be logged in to reply to this topic.