Remove brackets around "Filter by attributes" widget count

Hi,

I need to remove the bracktes around the post count in my sidebar for the “Filter Products by Attributes” widget.

I tried this two codes in my child functions.php but only worked for other filters.

function categories_postcount_filter ($variable) {
$variable = str_replace(’(’, ’ ‘, $variable);
$variable = str_replace(’)’, ’
', $variable);
return $variable;
}
add_filter(‘wp_list_categories’,‘categories_postcount_filter’);

function archive_postcount_filter ($variable) {
$variable = str_replace(’(’, ’ ‘, $variable);
$variable = str_replace(’)’, ’ ', $variable);
return $variable;
}
add_filter(‘get_archives_link’, ‘archive_postcount_filter’);

As you can see by the picture, the fix worked fine but not for all the widgets.

Could you please help me? I know it’s easy but I can’t find anything about it on google and I’m not a web developer :frowning_face:

Thanks in advance

P.S.: I’ll attache username and password in a secure note, in case you need to check the site

Hi there,

Please try this css code:

.x-sidebar .count {
    display: none;
}

Hope this helps.

Hi there,

maybe I did not explain it well… I need to remove just the brackets, the parenthesis around the count, not the count itself. :confused:

I need to have “Nuovo 23” instead of "Nuovo (23)"

Hope you could help me.

Thanks again in advance

Hi There,

Your website is down right now.

Could you please double check?

Thanks.

Hi there,

the site is up at this moment. Just checked…

Waiting for some news :slight_smile:

Thanks

Hi there,

Please replace your javascript with this

jQuery( function($) {

$('.woocommerce-widget-layered-nav-list .count').each( function() {

$(this).html( /(\d+)/g.exec( $(this).html() )[0] );

} );

} );

Hope this helps.

It works great!

Thanks a lot for your help :slight_smile:

You’re welcome.