Created
August 19, 2012 15:12
-
-
Save hzlzh/3395431 to your computer and use it in GitHub Desktop.
Customize the WordPress Tag Cloud Widget
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// the hook to custom tag widget, put in you `functions.php` | |
function my_tag_cloud_filter($args = array()) { | |
$args['smallest'] = 12; //最小字号 | |
$args['largest'] = 12; //最大字号 | |
$args['unit'] = 'px'; //字体单位 px,pt,em | |
$args['number'] = 20; //调用数量 | |
$args['orderby'] = 'count'; //按何值排序 | |
$args['order'] = 'RAND'; //排序方式 | |
// for more check here: http://codex.wordpress.org/Function_Reference/wp_tag_cloud | |
return $args; | |
} | |
add_filter('widget_tag_cloud_args', 'my_tag_cloud_filter', 10); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment