$blogcat = get_terms('cl-post-tax');
// Always show link in WP backend on custom post type or posts category
(example: https://clevis.sunlime.io/wp-admin/edit-tags.php?taxonomy=cl-post-tax&post_type=cl-post)
...
if($the_query->have_posts()) :
echo '<div class="category-filter">';
$blogcats = get_terms('cl-post-tax');
echo '<ul>';
foreach ( $blogcats as $blogcat ) {
// The $term is an object, so we don't need to specify the $taxonomy.
$cat_link = get_term_link( $blogcat );
// If there was an error, continue to the next term.
if ( is_wp_error( $cat_link ) ) {
continue;
}
// We successfully got a link. Print it out.
echo '<li><a href="' . esc_url( $cat_link ) . '">' . $blogcat->name . '</a></li>';
}
echo '</ul>';
echo '</div>';
while($the_query->have_posts()) : $the_query->the_post();
...