Is it outputting anything at all? Like a empty list?
What do you get if you output the results of the query
<?php $business_event = get_posts(array( 'post_type' => 'event', 'orderby' => array( 'event_date' => 'ASC', 'time_start' => 'ASC' ), 'meta_query' => array( array( 'key' => 'business_name', // name of custom field 'value' => '"' . get_the_ID() . '"', // matches exaclty "123", not just 123. This prevents a match for "1234" 'compare' => 'LIKE' ) ) )); // show results of above. echo '</pre>'; print_r($business_event); echo '</pre>'; ?>
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!
© 2022 Advanced Custom Fields.