• Resolved paul-g

    (@paul-g)


    Hi,

    i can’t figure out how to sort events by end-date. I use new WP_Query().
    I’ve tried the tribe_events_query_posts_orderby filter with

    add_filter( 'tribe_events_query_posts_orderby', 'change_tribe_query_orderby' );
    
    function change_tribe_query_orderby() {
            global $wpdb;
            return "tribe_event_end_date.meta_value ASC";
    }

    which worked at the front end but gave me an SQL-Error at the back end.

    I’ve also tried different query-vars like

    'orderby'=>'EventEndDate',
    'order' => 'ASC'

    or

    'meta_key'=>'_EventEndDate',
    'orderby' => 'meta_value',
    'order' => 'ASC'

    the first one had no effect and the second one returned the events but the EventStartDate was equal to EventEndDate in the var_dump of the query.

    https://wordpress.org/plugins/the-events-calendar/

Viewing 1 replies (of 1 total)
  • Plugin Contributor leahkoerper

    (@leahkoerper)

    Hi paul-g,

    As outlined in our forum guidelines, we aren’t able to help with these kinds of customizations. But we do have some handy resources that might be helpful for you:

    Themer’s Guide – provides an overview of how to customize the plugin’s frontend appearance.
    Tutorials – useful tips and tricks for changing how the plugin looks and behaves.
    Technical Docs – provides an overview of the classes and functions in each plugin

    Good luck, and thanks for using The Events Calendar!

    ~Leah

Viewing 1 replies (of 1 total)

The topic ‘Order/Sort by end-date in a WP_Query’ is closed to new replies.