0

I am attempting to style the widget tag cloud, however, it seems WordPress now adds style="font-size: 8pt;" automatically to the tag cloud class. Does anybody know how to remove this? Seems like a poor coding decision...

1

wp_generate_tag_cloud has a filter that allows you to edit the string input. You can use regex to find and remove the inline style:

add_filter('wp_generate_tag_cloud', 'na_tag_cloud',10,1);

function na_tag_cloud($string){
   return preg_replace("/style='font-size:.+pt;'/", '', $string);
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.