If you’d like to list the individual courses, i.e. the taxonomy terms, you’d use neither WP_Query
nor the WP standard Loop.
Instead, make use of the get_terms
function to retrieve the courses. It returns an array of term objects (if the taxonomy does exist and has terms matching the function arguments). Iterate over that and do something with it, such as displaying a list of links to the lessons:
$courses = get_terms( 'courses' );
if ( $courses ) {
echo '<ul class="course-list">';
foreach ( $courses as $course ) {
echo '<li>' .
'<a href="https://wordpress.stackexchange.com/courses/" . $course->slug . '" ' .
'title="' . sprintf( 'View lessons of %s', $course->name ) . '">' .
$course->name .
'</a>' .
'</li>';
}
echo '</ul>';
}