Put this function in functions.php
function show_categories($excl=''){
$categories = get_the_category($post->ID);
if(!empty($categories)){
$exclude=$excl;
$exclude = explode(",", $exclude);
foreach ($categories as $cat) {
if(!in_array($cat->cat_ID, $exclude)) {
echo '<p>' . $cat->cat_name . '</p>';
echo '<p>' . $cat->category_description . '</p>';
}
}
}
}
You can call this function inside the loop in your template by:
<?php show_categories('1,4,6'); ?>
the comma seperated list (‘1,4,6’) is a list of categories you want to exclude. if you don’t want to exlude use this:
<?php show_categories(); ?>
get_the_category is an array that produces these values
[term_id] => 5
[name] => News
[slug] => news
[term_group] => 0
[term_taxonomy_id] => 5
[taxonomy] => category
[description] => This is a news category
[parent] => 0
[count] => 3
[object_id] => 114
[cat_ID] => 5
[category_count] => 3
[category_description] => This is a news category
[cat_name] => News
[category_nicename] => news
[category_parent] => 0
so if you want the postcount in there you put this in the function:
echo '<p>' . $cat->count . '</p>';
and so on..