would love to know this too – i have searched and search
i managed to do this with the wp_categories_list in my child theme as follows:
// remove parentheses from category list and add span class to post count
function categories_postcount_filter ($variable) {
$variable = str_replace('(', '<span class="post-count"> ', $variable);
$variable = str_replace(')', ' </span>', $variable);
return $variable;
}
add_filter('wp_list_categories','categories_postcount_filter');
alas replacing wp_list_categories with wp_get_archives has no impact.
Anyone any ideas?
archives are a bit different:
add_filter('get_archives_link', 'archive_count_no_brackets');
function archive_count_no_brackets($links) {
$links = str_replace('</a> (', '</a> ', $links);
$links = str_replace(')', '', $links);
return $links;
}
alchymyth
THANK YOU SO MUCH!
hmmm *wonders why it is $links and not $variable*
– how does one know what parameter to pick?!
php nube here 🙁
hmmm *wonders why it is $links and not $variable*
– how does one know what parameter to pick?!
you can make one up – as long as it does not conflict with one of the global variables used by the core of wordpress 😉