How to show tag cloud with Wordpress
You can show the tag cloud very simple with WordPress.
For example, if you write theme (template) code like a following sample, you will be able to show tag cloud at your site at once.
|
In a word, you only use the standard tag (API of WordPress) prepared with WordPress.
It’s ver simple.()
wp_tag_cloud parameters.
Parameters
- smallest
- (integer) (optional) The text size of the tag with the smallest count value (units given by unit parameter).
- Default: 8
- largest
- (integer) (optional) The text size of the tag with the highest count value (units given by the unit parameter).
- Default: 22
- unit
- (string) (optional) Unit of measure as pertains to the smallest and largest values. This can be any CSS length value, e.g. pt, px, em, %.
- Default: ‘pt’
- number
- (integer) (optional) The number of actual tags to display in the cloud. (Use ‘0’ to display all tags.)
- Default: 45
- format
- (string) (optional) Format of the cloud display.
- 'flat' (Default) tags are separated by whitespace defined by ‘separator’ parameter
- 'list' tags are in UL with a class=’wp-tag-cloud’
- 'array' tags are in an array and function returns the tag cloud as an array for use in PHP Note: the array returned, rather than displayed, was instituted with Version 2.5.
- separator
- (string) (optional) The text/space between tags. Note: this parameter was introduced with Version 2.9.
- Default: ‘/n’ (whitespace)
- orderby
- (string) (optional) Order of the tags. Valid values:
- 'name' (Default)
- 'count'
- order
- (string) (optional) Sort order. Valid values – Must be Uppercase:
- 'ASC' (Default)
- 'DESC'
- 'RAND' tags are in a random order. Note: this parameter was introduced with Version 2.5.
- exclude
- (string) (optional) Comma separated list of tags (term_id) to exclude. For example, ‘exclude=5,27’ means tags that have the term_id 5 or 27 will NOT be displayed. Defaults to exclude nothing.
- include
- (string) (optional) Comma separated list of tags (term_id) to include. For example, ‘include=5,27’ means tags that have the term_id 5 or 27 will be the only tags displayed. Defaults to include everything.
- link
- (string) (optional) Set link to allow edit of a particular tag. Note: this parameter was introduced with Version 2.7. Valid values:
- 'view' (Default)
- 'edit'
- taxonomy
- (string) (optional) Taxonomy to use in generating the cloud. Note: this parameter was introduced with Version 2.8.
- 'post_tag' – (Default) Post tags are used as source of cloud
- 'category' – Post categories are used to generate cloud
- 'link_category' – Link categories are used to generate cloud
- echo
- (boolean) (optional) Show the result or keep it in a variable. The default is true (display the tag cloud). Note: this parameter was introduced with Version 2.8. Valid values:
- 1 (true) – default
- 0 (false)
|
In a previous example, the following parameters are used.
- The text size of the tag with the highest count value: 18px
- orderby: count
- order: ‘DESC’
WordPress is very fine.()
In general, CMS will need extension(plug-in etc) if you want to show tag cloud, but WordPress can work with only default api.()
The tag cloud is the one that how much tag (word) is contained in the article is visually displayed.
It was assumed that this was better for SEO. (it’s long long ago? () I do not know now. )
However, regardless of SEO, I think it is interesting, because the reader can know summary of post at once by tag cloud.
However, if the writer doesn’t clearly write related tag, the tag cloud does not work very well.
If you want to work tag cloud very well, you must write clearly related tag at right side of editor.
You might also like:
Comments
2 Responses to “How to show tag cloud with WordPress”
Leave a Reply
May 15th, 2010 @ 15:17:04
[…] This post was mentioned on Twitter by Hidenori Funaki. Hidenori Funaki said: メモです。Wordpressでタグクラウドを表示する。http://blog.off-soft.net/wordpress/tag_cloud.html […]
August 11th, 2011 @ 18:01:56
[…] タグクラウド です。表示は wp_tag_cloud() を使います。 WordPressでタグクラウドを表示する – BLOG OFF SOFT.com 上記リンクを参考に、下記のコードは […]