Support

Home Forums Event Espresso Premium Event list: Order by start_date via PHP snippet

Event list: Order by start_date via PHP snippet

Posted: August 31, 2022 at 7:25 am

Viewing 0 reply threads


YvonneDeffner

August 31, 2022 at 7:25 am

Hi there,

I´m using Elementor Pro to setup page with Event Espresso booking functions.

I´ve used Elementor posts widget to display Event lists because there is option to show it in a cards look and has many options to style.
But there is 1 problem: Order by options by this widget are ignored in frontend (and my wished order-option is not there).

So I tried to inject my wished ordering as PHP snippet:

function my_query_by_different_order( $query ) {
	$query->set( 'orderby', 'event_start_date ASC' );
}
add_action( 'elementor/query/my_custom_filter', 'my_query_by_different_order' );

But this doesn´t work. Do you have an idea what PHP snippet could work for ordering by start date in event lists?

Thank you and best regards
Anna-Lena

Viewing 0 reply threads

The support post ‘Event list: Order by start_date via PHP snippet’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso