In the default category widget, when you check the "show posts count" checkbox, the number of posts appear surrounded by parentheses, how to remove them.
Tell me more
×
WordPress Answers is a question and answer site for
WordPress developers and administrators. It's 100% free, no registration required.
|
|
Add this code to your functions.php file and it will remove the parentheses and surround the post count with a span with a class to easily style it.
++Bonus In the archive widget, if you checked "Show posts count" checkbox you'll see the same parentheses around posts count, here's another filter to remove them and add a class to easily style theme.
function archive_postcount_filter ($variable) {
$variable = str_replace('(', ' ', $variable);
$variable = str_replace(')', ' ', $variable);
return $variable;
}
add_filter('get_archives_link', 'archive_postcount_filter');
|
|||||||
|