TEST
FORUM
Function My_TagCloud($params=array()){
Extract(shortcode_atts(array(
โorderbyโ=>โnameโ
โorderโ => โASCโ,
โnumberโ=>โโ,
โwrapperโ => โโ,
โsizeclassโ => โtaggedโ,
โsizeminโ => 1,
โsizemaxโ=> 5
), $params));
Now, initialize the HTML returns.
//initialize
$ret = โโ;
$min = 9999999; $max = 0;
Now, the get_tag() function is started to return the array of subject;
//fetch all wordpress tags
$tags = get_tags(array(โorderbyโ =>$orderby, โorderโ => $order, โnumberโ => $number))
To know the minimum and maximum number of tags used:
//get minimum and maximum number tags
Foreach ($tags as $tag) {
$min = min($min, $tag->count);
$max = max($max, $tag->count);
}
To generate the tag list:
Foreach ($tags as $tag) {
$url=get_tag_link($tag->term_id);
$title = $tag->count. โarticleโ. ($tag->count == 1? โโ:โsโ);
With all these codes, the HTML tag and end of loop can be created:
$ret.=
($wrapper ?<โwrapperโ> ;โ
<โa href=\โ$url\โ class=\โtitle=\โ$title\โ>{$tag->name}โ.
($wrapper? โ$wrapper>โ : โ);