I am having a small problem but was hoping maybe someone can help me with it. I am displaying the number of posts in a certain category within the header of my site. IE: Category Name (12).
On the main index page and the search results page and the posts page its working PERFECTLY, but if I go into a category page for some reason the number blanks out. IE: Category Name ()
This is the code I am using to display the number, maybe someone can point out why it wouldn't show the number on category pages as well?
Thank you in advance,
LawMaker
<?php
$cat = get_query_var('cat');
$categories=get_categories('include=5'.$cat);
if ($categories) {
foreach($categories as $category) {
echo '' . $category->count;
}
}
?>
Note: include=5 is the category ID.