Exclude WordPress Category in query loop

I have a WordPress loop which outputs a category link.
I need to exclude a particluar category from this loop (the parent).
The category I need to exclude is named ‘artists’.

Here is the current loop….

 foreach((get_the_category()) as $category) {
 if($category->name=='.THIS IS A FEATURED POST') continue;
 $category_id = get_cat_ID( $category->cat_name );
 $category_link = get_category_link( $category_id );
 echo '<span class="cat-links">ALL NEWS FOR: <a href="'.$category_link.'">'.$category->cat_name.'</a></span><br /> ';
 } ?>

Any thoughts as to how I can exclude that one category from the above loop? Any help appreciated.

Read more here: Exclude WordPress Category in query loop

Leave a Reply

Your email address will not be published. Required fields are marked *