-1

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="http://5.10.105.54/~shayjcoi/shayj/portfolio_category/Yellow/" rel="tag">Yellow</a></br><a href="http://5.10.105.54/~shayjcoi/shayj/portfolio_category/Main/" rel="tag">Main</a>

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

0

1 Answer 1

0

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) {
  remove_filter('get_the_terms','exclude_my_term',10,3);
  unset($terms[123]); // where 123 is the ID of the term to exclude
  return $terms;
}
add_filter('get_the_terms','exclude_my_term',10,3);

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.