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….

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


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: