我相信你想要的是排除一个术语。奇怪的是,这不是该函数的选项,但您可以在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);
你可能想在打电话给
get_the_term_list()
.