Replace…
cat_to_exclude
with the name of the category…
Using Michael’s example…
You use the category name and not the ID… it’s quite self explanatory if you look at the code…
<?php
// For each of the categories, create them as category variables
foreach((get_the_category()) as $category) {
// If the category is NOT the cat_name (category name) then echo some stuff
// So grab all... except where they match cat_name (exclude basically)
if ($category->cat_name != 'cat_to_exclude') {
echo '<a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a> ';
}
}
?>
I added a few comments in there (the code will still work), but it should be obvious.