Wrap the “show_post_count” between div

You can style the post count differently via CSS with the given markup. It’s not very practical but by making use of the cascading nature of CSS, you could do this:

.post_count { /* styles for the post count number in parenthesis */ }
.post_count a { /* styles for the link, be sure to override properties from the line above if needed */ }

Whatever you do, don’t edit the wp_get_archives() function directly. You will lose your changes when WP gets updated. That function does not provide any useful filters for doing what you want.

If you want to wrap the post count in an additional HTML element, try this approach. By returning the output of wp_get_archives() you have the option to tweak the markup and target the count directly via CSS (.post_count .count):

// Generate the default list
$html = wp_get_archives( array(
    'show_post_count' => true,
    'echo' => false,
) );
// Wrap the post count in a span element
$html = preg_replace( '~(&nbsp;)(\(\d++\))~', '$1<span class="count">$2</span>', $html );
// Output the result
echo $html;

Note: I am well aware that parsing HTML using regular expressions is considered evil. No need to remind me about that. I’m all ears for better solutions.

tech