一种可能的方法是:在函数中添加过滤器。主题的php:
add_filter ( \'wp_tag_cloud\', \'tag_cloud_slug_class\' );
function tag_cloud_slug_class( $taglinks ) {
$tags = explode(\'</a>\', $taglinks);
$regex = "#(.*tag-link[-])(.*)(\' title.*)#e";
foreach( $tags as $tag ) {
$tagn[] = preg_replace($regex, "(\'$1$2 tag-\'.get_tag($2)->slug.\'$3\')", $tag );
}
$taglinks = implode(\'</a>\', $tagn);
return $taglinks;
}