>

How to make tag cloud using native tagging in Wordpress 2.3

From the builtin native tagging feature in Wordpress 2.3, you can make your own tag cloud easily.
Usage
< ?php wp_tag_cloud(''); ?>

Examples
Default Usage

$defaults = array('smallest' => 8, 'largest' => 22,
'unit' => 'pt', 'number' => 45, 'format' => 'flat',
'orderby' => 'name', 'order' => 'ASC','exclude' => , 'include' => );

By default, the usage shows:

* smallest - Use 8 point font-size when displaying the tag with lowest count value
* largest - Use 22 point font-size when displaying the tag with highest count value
* unit - Describes ‘pt’ (point) as the font-size unit for the smallest and largest values
* number - Display at most 45 tags
* format - Displays the tags in flat (separated by whitespace) style
* orderby - Order the tags by name
* order - Sort the tags in ASCENDING fashion
* exclude - Exclude no tags
* include - Include all tags

Cloud displayed under Popular Tags title

< ?php if ( function_exists('wp_tag_cloud') ) : ?>

Popular Tags

< ?php wp_tag_cloud('smallest=8&largest=22'); ?>

< ?php endif; ?>

Cloud limited in size and ordered by count rather than name

< ?php wp_tag_cloud('smallest=8&largest=22&number=30&orderby=count'); ?>

Parameters

smallest
(integer) The unit (font) size to use when displaying the tag with the smallest count value.
largest
(integer) The unit (font) size to use when displaying the tag with the highest count value..
unit
(string) Unit of measure as pertains to the smallest and largest values. Use pt for point.
number
(integer) The number of actual tags to display in the cloud. (Use ‘0′ to display all tags.)
format
(string) Format of the cloud display.

* ‘flat’ (Default) tags are separated by whitespace
* ‘list’ tags are in UL with a class=’wp-tag-cloud’
* ‘array’ tags are in an array

orderby
(string) Order of the tags. Valid values:

* ‘name’ (Default)
* ‘count’

order
(string) Sort order. Valid values - Must be Uppercase:

* ‘ASC’ (Default)
* ‘DESC’

exclude
(string) 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) 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.

Comments :

1
E-Tavasi said...
on 

Tag cloud is nice :)

Post a Comment