This is what I settled on:
<?php if($this->params->get('catTitle')): ?>
<!-- Category title -->
<h2><?php echo $this->category->name; ?></h2><?php if($this->params->get('catTitleItemCounter') && $this->pagination->total==1) {echo '<h4 style="color:#a09db1;margin-top:-2.25em;text-shadow:none"><br />(There is 1 item in this section)</h4>';} elseif(!$this->params->get('catTitleItemCounter') && $this->pagination->total==1){ echo '<h4 style="color:#a09db1;margin-top:-2.25em;text-shadow:none"><br />(There are no items in this section yet)</h4>';} else {echo '<h4 style="color:#a09db1;margin-top:-2.25em;text-shadow:none"><br />(There are '.$this->pagination->total.' items in this section)</h4>';} ?>
<?php endif; ?>
I really don't understand this, can someone explain to me why this works?? I created it, but I don't understand what is going on.
catTitleItemCounter is set in params to display or not display, 1, 0; $this->pagination->total counts anything that produces a page including sub-categories and items. Yes I should remove the styles to css, I will do that later.
Is there a way to test for items/articles only and not items + sub-categories? In other word if a category contains 10 sub-categories but none of the subcategories contain any items/articles, is there a way to test for that?