I am using :

$term_link = get_the_term_list($post->ID, 'portfolio_category', '', '<br />', '');

to get the category and link to it.

There is any way to get all category despite specific one?

Now i get :

<a href="" rel="tag">Yellow</a></br><a href="" rel="tag">Main</a>

And i want to get all the category despite the "Main" category.


1 Answer 1


I believe that what you want is to exclude a term. It is odd that such is not an option with that function but you can use a filter on get_the_terms:

function exclude_my_term($terms, $post, $taxonomy) {
  unset($terms[123]); // where 123 is the ID of the term to exclude
  return $terms;

You probably want to run that just before your call to get_the_term_list().

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.