Detailed query filtering by your own date fields
-
Hello. I have a problem with the construction of the filter placed in the functions.php fileadd_action( 'elementor/query/my_custom_filter', function( $query ) { //print $Ldat=date('Y-m-d'); $query->set( 'meta_key', 'data_wydarzenia' ); $query->set( 'orderby', 'meta_value' ); $query->set( 'order', 'ASC' ); });
This code works great and sorts my posts by an additional field with a date. Now I need to modify it so that posts with a date greater than today are displayed. Posts are training courses that are to take place. I don’t want to see them when they expire. Please help
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Detailed query filtering by your own date fields’ is closed to new replies.