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; ?>