I have an Elementor site using ACF to create a custom post called coach-tour. Within the custom post I have created a date-picker field called trip_departure_date
I have these listed in a loop grid and ordered in date order (soonest first) using this PHP code:
add_action( 'elementor/query/trip_sorted_by_date', function( $query ) {
$query->set( 'meta_key', 'trip_departure_date' );
$query->set( 'orderby', 'meta_value_num' );
$query->set( 'order', 'ASC' );
});
Is there a way to modify this code so that only posts that occur after todays date are displayed. i.e. when trip departure date is passed, those posts will be hidden.
Add condition :