TEST

Forum breadcrumbs - You are here:FORUM

FORUM

FanArtLast post
DiscussionLet's talk about FanArt!0 Topics · 0 PostsNo topics yet!
No topics yet!
SiteLast post
ChangesWhat to add or change on TibiaFanart?2 Topics · 2 PostsLast post: What items and objects would you l … · 2 years ago · Makadamia
Bugs/ErrorsSomething is wrong? Report it here!0 Topics · 0 PostsNo topics yet!
No topics yet!
HelpAny questions about TibiaFanart? Ask here!0 Topics · 0 PostsNo topics yet!
No topics yet!
ContestsLast post

 

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? โ€œโ€ : โ€œ);

error: Content is protected !!