La fonction WordPress the_category n'offre pas de paramètre d'exclusion. Cela fait:
function exclude_post_categories($excl='', $spacer=' ') ( $categories = get_the_category($post->ID); if (!empty($categories)) ( $exclude = $excl; $exclude = explode(",", $exclude); $thecount = count(get_the_category()) - count($exclude); foreach ($categories as $cat) ( $html = ''; if (!in_array($cat->cat_ID, $exclude)) ( $html .= 'cat_ID) . '" '; $html .= 'title="' . $cat->cat_name . '">' . $cat->cat_name . ''; if ($thecount > 0) ( $html .= $spacer; ) $thecount--; echo $html; ) ) ) )
De plus, tant que vous l'avez, vous pouvez modifier la sortie comme vous le souhaitez, ce qui est bien.
L'utilisation est comme:
Ce qui listerait toutes les catégories à l'exclusion de celle avec l'ID de 4.