Hi all!
I've been strugling with this for a while now, but cant figure it out. Guess its more of a php question then wp..
Ok. I want to List all my tags and i want to order them by the ammount of posts that has the tag.
This is what i got so far:
$tags = get_tags();
$tags_count = count($tags);
$top = 15;
//$tags[$i]->count
for ($i = 0;$i < $tags_count;$i++):
$slug = $tags[$i]->slug;
if ($i < $top){
echo "<li><a href='".get_tag_link($tags[$i]->term_id)."'>".$slug."</a></li>";
The reason for $top is that after 15 tags listed im hiding the others, displaying them when user want to view more.
So, could anyone point me to how to resolve this?! Would be awesome. I know how to count the posts for each tag. But not ho to sort by it!