Hi
I have been googeling all day now, trying to find a solution to my problem.
I want to modify the output of my Categories widget so that it puts a span class or something around the post count, so i can style it the way i want.
Does anyone have a suggestion how i can do this?
yochi
try to add a filter function to functions.php of your theme;
for instance:
add_filter('wp_list_categories', 'add_span_cat_count');
function add_span_cat_count($links) {
$links = str_replace('</a> (', '</a> <span>(', $links);
$links = str_replace(')', ')</span>', $links);
return $links;
}
if you need a css class on the span, add it here in the above:
<span>
for instance:
<span class="cat-count">
Thank you very much. That worked:)