This code works only for non anchor categories - how can I get the product count of anchor category?
<div class="grid_16"><h1 class="highlight pageTitle"><?php echo $_helper->categoryAttribute($_category, $_category->getName(), 'name') ?>
<span>
(<?php echo $_category->getProductCount() ?>)
</span>
</h1></div>
$prodCollection = Mage::getResourceModel('catalog/product_collection')->addCategoryFilter($category);
var_dump($prodCollection->count());
As seen here : magento forum
$category_object = Mage::getModel('catalog/category')->load( CATEGORY_ID ); // If you don't already have one
$total = Mage::getModel('catalog/layer')->setCurrentCategory( $category_object )->getProductCollection()->getSize()
Will show correct number of products