\n
<?php<\/span> wp_tag_cloud(<\/span> $args<\/span> )<\/span>;<\/span> ?><\/span><\/pre>\n<\/div>\n<\/div>\n<\/span>\u9ed8\u8ba4\u7528\u6cd5<\/strong><\/span><\/h4>\n\n
\n
<?php<\/span> $args<\/span> =<\/span> array<\/span>(<\/span><\/pre>\n\t'smallest'<\/span> =><\/span> 8<\/span>,<\/span><\/pre>\n\t'largest'<\/span> =><\/span> 22<\/span>,<\/span><\/pre>\n\t'unit'<\/span> =><\/span> 'pt'<\/span>,<\/span><\/pre>\n\t'number'<\/span> =><\/span> 45<\/span>,<\/span><\/pre>\n\t'format'<\/span> =><\/span> 'flat'<\/span>,<\/span><\/pre>\n\t'separator'<\/span> =><\/span> \"\\n<\/span>\"<\/span>,<\/span><\/pre>\n\t'orderby'<\/span> =><\/span> 'name'<\/span>,<\/span><\/pre>\n\t'order'<\/span> =><\/span> 'ASC'<\/span>,<\/span><\/pre>\n\t'exclude'<\/span> =><\/span> null<\/span>,<\/span><\/pre>\n\t'include'<\/span> =><\/span> null<\/span>,<\/span><\/pre>\n\t'topic_count_text_callback'<\/span> =><\/span> default_topic_count_text,<\/span><\/pre>\n\t'link'<\/span> =><\/span> 'view'<\/span>,<\/span><\/pre>\n\t'taxonomy'<\/span> =><\/span> 'post_tag'<\/span>,<\/span><\/pre>\n\t'echo'<\/span> =><\/span> true<\/span>,<\/span><\/pre>\n\t'child_of'<\/span> =><\/span> null<\/span>,<\/span> \/\/ see Note!<\/span><\/pre>\n)<\/span>;<\/span> ?><\/span><\/pre>\n<\/div>\n<\/div>\n\u6ce8\uff1a child_of \u4e0d\u662f\u4e00\u4e2a\u76f4\u63a5\u7684 wp_tag_cloud \u6570\u7ec4\u7684\u952e\uff08Key\uff09\uff0c\u4f46\u7531\u4e8e\u8fd9\u4e2a\u51fd\u6570\u4f7f\u7528 wp_parse_args() \u548c get_terms() \uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7 get_terms() \u4f7f\u7528\u6240\u6709\u7684\u6570\u7ec4\u952e\u3002<\/p>\n
\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u7684\u8f93\u51fa\u5185\u5bb9\uff1a<\/p>\n
smallest<\/code><\/p>\n\u2014\u2014 \u6700\u5c0f\u7684\u6807\u7b7e\uff08\u4f7f\u7528\u6b21\u6570\u6700\u5c11\uff09\u663e\u793a\u5927\u5c0f\u4e3a8<\/ol>\nlargest<\/code><\/p>\n\u2014\u2014\u6700\u5927\u7684\u6807\u7b7e\uff08\u4f7f\u7528\u6b21\u6570\u6700\u591a\uff09\u663e\u793a\u5927\u5c0f\u4e3a22<\/ol>\nvunit<\/code><\/p>\n\u2014\u2014 \u6700\u5927\u503c\u6700\u5c0f\u503c\u7684\u5355\u4f4d\u4e3a’pt’<\/ol>\nnumber<\/code><\/p>\n\u2014\u2014 \u81f3\u591a\u663e\u793a45\u4e2a\u6807\u7b7e<\/ol>\nformat<\/code><\/p>\n\u2014\u2014 \u4ee5\u5e73\u9762\u5f62\u5f0f\u663e\u793a\u6240\u6709\u6807\u7b7e\uff08\u6807\u7b7e\u4e4b\u95f4\u7528\u7a7a\u683c\u9694\u5f00\uff09<\/ol>\nseparator<\/code><\/p>\n\u2014\u2014 \u663e\u793a\u6807\u7b7e\u4e4b\u95f4\u7684\u7a7a\u683c<\/ol>\norderby<\/code><\/p>\n\u2014\u2014 \u6309\u540d\u79f0\u4e3a\u6807\u7b7e\u6392\u5e8f<\/ol>\norder<\/code><\/p>\n\u2014\u2014 \u4ee5\u5347\u5e8f\u6392\u5217<\/ol>\nexclude<\/code><\/p>\n\u2014\u2014 \u4e0d\u6392\u9664\u4efb\u4f55\u6807\u7b7e<\/ol>\ninclude <\/code><\/p>\n\u2014\u2014 \u5305\u62ec\u6240\u6709\u6807\u7b7e<\/ol>\ntopic_count_text_callback<\/code><\/p>\n\u2014\u2014 \u4f7f\u7528\u51fd\u6570 default_topic_count_text<\/ol>\nvlink<\/code><\/p>\n\u2014\u2014 \u53ef\u89c6<\/ol>\ntaxonomy<\/code><\/p>\n\u2014\u2014 \u7528\u6587\u7ae0\u7684\u6807\u7b7e\u4f5c\u4e3a\u4e91\u57fa\u7840<\/ol>\necho <\/code><\/p>\n\u2014\u2014 \u8f93\u51fa\u7ed3\u679c<\/ol>\n<\/span>\u53c2\u6570<\/strong><\/span><\/h2>\nsmallest<\/code>
\n\uff08\u6574\u6570\uff09\uff08\u53ef\u9009\uff09\u4f7f\u7528\u6b21\u6570\u6700\u5c11\u7684\u6807\u7b7e\u7684\u5b57\u53f7\u5927\u5c0f\uff08\u5355\u4f4d\u7531unit\u53c2\u6570\u51b3\u5b9a\uff09
\n\u9ed8\u8ba4\u503c\uff1a8
\nlargest<\/code>
\n\uff08\u6574\u6570\uff09\uff08\u53ef\u9009\uff09\u4f7f\u7528\u6b21\u6570\u6700\u591a\u7684\u6807\u7b7e\u7684\u5b57\u53f7\u5927\u5c0f\uff08\u5355\u4f4d\u7531unit\u53c2\u6570\u51b3\u5b9a\uff09
\n\u9ed8\u8ba4\u503c\uff1a22
\nunit<\/code>
\n\uff08\u5b57\u7b26\u4e32\uff09\uff08\u53ef\u9009\uff09\u5bf9smallest\u4e0elargest\u7684\u503c\u7684\u6d4b\u91cf\u5355\u4f4d\u3002\u53ef\u4ee5\u662f\u4efb\u4f55CSS\u957f\u5ea6\u5355\u4f4d\uff0c\u5982pt, px, em, %\u3002
\n\u9ed8\u8ba4\u503c\uff1a’pt’<\/p>\nnumber<\/code><\/p>\n\uff08\u6574\u6570\uff09\uff08\u53ef\u9009\uff09\u663e\u793a\u5728\u4e91\u4e2d\u7684\u5b9e\u9645\u6807\u7b7e\u6570\u3002\uff08\u503c\u4e3a’0’\u65f6\u663e\u793a\u6240\u6709\u6807\u7b7e\uff09<\/p>\n
\u9ed8\u8ba4\u503c\uff1a45<\/p>\n
format<\/code><\/p>\n\uff08\u5b57\u7b26\u4e32\uff09\uff08\u53ef\u9009\uff09\u6240\u663e\u793a\u7684\u4e91\u7684\u683c\u5f0f\u3002<\/p>\n
‘flat’ \uff08\u9ed8\u8ba4\u503c\uff09\u6807\u7b7e\u88ab\u201cseparator\u201d\u53c2\u6570\u6240\u5b9a\u4e49\u7684\u7a7a\u683c\u5206\u9694
\n‘list’ \u6807\u7b7e\u4e0eclass=’wp-tag-cloud’ \u5171\u540c\u5728UL\u4e2d
\n‘array’ \u6807\u7b7e\u5728\u6570\u7ec4\u4e2d\uff0c\u51fd\u6570\u4ee5\u6570\u7ec4\u65b9\u5f0f\u8fd4\u56de\u6807\u7b7e\u4e91\uff0c\u4ee5\u7528\u5728PHP\u4e2d\u3002\u6ce8\u610f\uff1a\u6570\u7ec4\u88ab\u8fd4\u56de\uff0c\u800c\u975e\u663e\u793a\u3002
\nseparator
\n<\/code>
\n\uff08\u5b57\u7b26\u4e32\uff09\uff08\u53ef\u9009\uff09\u6807\u7b7e\u4e4b\u95f4\u7684\u6587\u672c\/\u7a7a\u683c\u3002<\/p>\n\u9ed8\u8ba4\u503c\uff1a’\\n’ \uff08\u7a7a\u683c\uff09<\/p>\n
orderby<\/code><\/p>\n\uff08\u5b57\u7b26\u4e32\uff09\uff08\u53ef\u9009\uff09\u6807\u7b7e\u7684\u6392\u5217\u4f9d\u636e\u3002\u6709\u6548\u503c\u5305\u62ec\uff1a<\/p>\n
‘name’ \uff08\u9ed8\u8ba4\u503c\uff09
\n‘count’
\norder<\/code><\/p>\n\uff08\u5b57\u7b26\u4e32\uff09\uff08\u53ef\u9009\uff09\u6392\u5217\u987a\u5e8f\uff08\u5347\u5e8f\u6216\u964d\u5e8f\uff09\u3002\u6709\u6548\u503c\u5305\u62ec\uff08\u5fc5\u987b\u5927\u5199\uff09\uff1a<\/p>\n
‘ASC’ \u2014\u2014\u5347\u5e8f\uff08\u9ed8\u8ba4\u503c\uff09
\n‘DESC’ \u2014\u2014\u964d\u5e8f
\n‘RAND’ \u2014\u2014 \u968f\u673a
\nexclude<\/code><\/p>\n\uff08\u5b57\u7b26\u4e32\uff09\uff08\u53ef\u9009\uff09\u5c06\u8981\u88ab\u6392\u9664\u7684\u6807\u7b7e\uff08term_id\uff09\u7684ID\uff0c\u5404ID\u7528\u9017\u53f7\u9694\u5f00\u3002\u5982 ‘exclude=5,27’\u8868\u793a\u4e0d\u663e\u793aterm_id\u4e3a5\u621627\u7684\u6807\u7b7e\u3002\u9ed8\u8ba4\u503c\u4e3a\u4e0d\u6392\u9664\u4efb\u4f55\u6807\u7b7e\u3002<\/p>\n
include<\/code><\/p>\n\uff08\u5b57\u7b26\u4e32\uff09\uff08\u53ef\u9009\uff09\u8981\u5305\u542b\u7684\u6807\u7b7e\uff08term_id\uff09\u5217\u8868\uff0c\u5404ID\u7528\u9017\u53f7\u9694\u5f00\u3002\u4f8b\u5982\uff0c ‘include=5,27’ \u8868\u793a\u53ea\u663e\u793aterm_id\u4e3a5\u621627\u7684\u6807\u7b7e\u3002\u9ed8\u8ba4\u4e3a\u5305\u542b\u6240\u6709\u94fe\u63a5\u3002<\/p>\n
topic_count_text_callback<\/code><\/p>\n\uff08\u5b57\u7b26\u4e32\uff09\uff08\u53ef\u9009\uff09\u7ed9\u51fa\u6807\u7b7e\u6240\u5173\u8054\u7684\u6587\u7ae0\u6570\uff0c\u8fd4\u56de\u6807\u7b7e\u94fe\u63a5\u7684\u7528\u4e8e tooltip \u7684\u6587\u672c\u3002<\/p>\n
\u9ed8\u8ba4\u503c\uff1a default_topic_count_text<\/p>\n
link<\/code><\/p>\n\uff08\u5b57\u7b26\u4e32\uff09\uff08\u53ef\u9009\uff09\u8bbe\u7f6e\u94fe\u63a5\uff0c\u5141\u8bb8\u7f16\u8f91\u67d0\u4e2a\u6307\u5b9a\u6807\u7b7e\u3002\u6709\u6548\u503c\u5305\u62ec\uff1a<\/p>\n
‘view’ \uff08\u9ed8\u8ba4\u503c\uff09
\n‘edit’
\ntaxonomy<\/code><\/p>\n\uff08\u5b57\u7b26\u4e32\uff09\uff08\u53ef\u9009\uff09\u7528\u4ee5\u751f\u6210\u4e91\u7684\u5206\u7c7b\u6cd5\u3002<\/p>\n
‘post_tag’ \u2014\u2014 \uff08\u9ed8\u8ba4\u503c\uff09\u5c06\u6587\u7ae0\u6807\u7b7e\u5f53\u4f5c\u4e91\u7684\u6765\u6e90
\n‘category’ \u2014\u2014 \u7528\u6587\u7ae0\u5206\u7c7b\u751f\u6210\u4e91
\n‘link_category’ \u2014\u2014 \u7528\u94fe\u63a5\u5206\u7c7b\u76ee\u5f55\u751f\u6210\u4e91
\n\u4efb\u4f55\u5176\u4ed6\u5df2\u6ce8\u518c\u7684\u5206\u7c7b\u6cd5
\n\u6216\u8005\u4e00\u7ec4 \u5206\u7c7b\u6cd5 \uff08\u6ce8\uff1a\u6b64\u53c2\u6570\u5f15\u5165\u4e8e 3.1 \u7248\u672c\uff09
\necho<\/code><\/p>\n\uff08\u5e03\u5c14\u578b\uff09\uff08\u53ef\u9009\uff09\u663e\u793a\u7ed3\u679c\uff0c\u6216\u5c06\u7ed3\u679c\u4fdd\u7559\u5728\u53d8\u91cf\u4e2d\u3002\u9ed8\u8ba4\u503c\u4e3atrue\uff08\u663e\u793a\u6807\u7b7e\u4e91\uff09\u3002\u6709\u6548\u503c\u5305\u62ec\uff1a<\/p>\n
1 (true) \u2014\u2014 \u9ed8\u8ba4\u503c
\n0 (false)<\/p>\n
<\/span>\u4f8b\u5b50<\/strong><\/span><\/h2>\n<\/span>1\u3001\u663e\u793a\u6807\u9898\u4e3aPopular Tags\u7684\u4e91<\/strong><\/span><\/h3>\n\n
\n
<?php<\/span> if<\/span> (<\/span> function_exists<\/span>(<\/span> 'wp_tag_cloud'<\/span> )<\/span> )<\/span> :<\/span> ?><\/span><\/pre>\n<h2>Popular Tags<\/h2><\/pre>\n<ul><\/pre>\n<li><?php<\/span> wp_tag_cloud(<\/span> 'smallest=8&largest=22'<\/span> )<\/span>;<\/span> ?><\/span><\/li><\/pre>\n<\/ul><\/pre>\n<?php<\/span> endif<\/span>