Thanks for the reply @elliot, however, adding the endif; doesn’t solve it. It still is spitting out the word ‘test’ infinitely and crashing the site, rather than what is to be expected.
<?php $courses = get_posts(array( 'meta_query' => array( array( 'key' => 'short_course', // name of custom field 'value' => '"yes"', // matches exaclty "yes", not just yes. This prevents a match for "acquired" 'compare' => 'LIKE' ) ) )); if ( $courses ) : while ( $courses ) : ?> test <?php endwhile; endif; ?>
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.