Remove category counts when it shows zero

From OSClass

This is a simple customization that will remove ad counts next to categories and subcategories when they do not contain any ads and shows (0). This works with most themes (BCute theme is used here).

Here is an example showing the default way category ad counts are displayed:

Catcountbefore.jpg


To change this, edit the file main.php within your theme directory. Then, locate this code (note: this code appears twice in the file, so find both instances):

<span>(<?php echo osc_category_total_items() ; ?>)</span>


Replace it with this code:

<span><?php if(osc_category_total_items()>0){ echo '('.osc_category_total_items().')';} ?></span>


Now, it should look something like this:

Catcountafter.jpg


If you want to completely remove ALL category ad counts permanently, remove both instances of this code:

<span>(<?php echo osc_category_total_items() ; ?>)</span>



--Jesse 14:17, 21 December 2011 (CET)