Support

Account

Home Forums General Issues Checkbox while loop if value exists Reply To: Checkbox while loop if value exists

  • Hi again @elliot

    Thanks for your continual help.

    My code now stands as this:

    <?php $courses = get_posts(array(
    			'meta_query' => array(
    				array(
    				'key' => 'short_course',
    				'value' => '"yes"',
    				'compare' => 'LIKE'
    				)
    			)
    		));
    		if ( $courses ) : foreach ($courses as $course) : ?>
    			<a href="<?php the_permalink($course->ID); ?>">test</a>
    		<?php endforeach; endif; ?>

    But the permalink isn’t bringing back the permalink URL… only the current page URL. Am I missing something?