Home › Forums › General Issues › Sorting using ACF Date field › Reply To: Sorting using ACF Date field
Can i find a update of this code ? I have try, But not working.
I use now this code:
function dd_query_by_event_date( $query ) {
$query->set( ‘orderby’, ‘meta_value’ );
$query->set( ‘meta_key’, ‘start_date’ );
$query->set( ‘meta_query’, array(
array(
‘key’ => ‘start_date’,
‘value’ => date( ‘Y-m-d’ ),
‘compare’ => ‘>=’,
‘type’ => ‘DATETIME’,
),
) );
}
add_action( ‘elementor/query/dd_event_date’, ‘dd_query_by_event_date’ );
But with this code you have the problem as described above, the problem that it no longer displays everything from the start date
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.