<?php $args = array(
'show_count' => 1,
'show_option_none' => '',
'title_li' => '',
'echo' => 0 /* 直接出力させない為 */
/*他に必要なパラメータも各自設定。ここでは省略*/
);
$catlist = wp_list_categories( $args );
$catlist = preg_replace('/<\/a> \(([0-9]+)\)/', ' <span class="count">\\1</span></a>', $catlist );
if ( !empty($catlist) ) {
echo '<ul>'.$catlist.'</ul>';
} ?>