Is there a nice way to remove the inline style from wordpress tag cloud tags? I'd like to set the same size for all tags and do not want inline styles at all if I can help it.
Thanks
You can use WordPress' core filters to modify output by different functions. wp_generate_tag_cloud()
has a filter that allows you to edit the string input. Below is a function that regexs the string, finds the inline style and removes it.
add_filter('wp_generate_tag_cloud', 'xf_tag_cloud',10,3);
function xf_tag_cloud($tag_string){
return preg_replace("/style='font-size:.+pt;'/", '', $tag_string);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With