This might work for you:
<?php
$tags = get_tags( array('orderby' => 'count', 'order' => 'DESC') );
foreach ( (array) $tags as $tag ) {
echo '<a href="' . get_tag_link ($tag->term_id) . '" rel="tag">' . $tag->name . ' (' . $tag->count . ') </a>';
}
?>
Oops, found this plugin that might help also:
http://wordpress.org/extend/plugins/list-tags/
I used the code shown above and it worked great.
I’m trying to sort my tags by initial letter (all the A’s under A, etc.).
From the “get_tags” function page I think the “name_like” argument should pull this off, but for some reason, it’s not working. This is what I have:
<ul>
<?php
$tags = get_tags( array('name_like' => "a", 'order' => 'ASC') );
foreach ( (array) $tags as $tag ) {
echo '<li><a href="' . get_tag_link ($tag->term_id) . '" rel="tag">' . $tag->name . ' </a></li>';
}
?>
</ul>
Any thoughts on what I’m doing wrong? Am I using the name_like argument wrong?
How can i include or exclude particular tags in the list ?
hi michael
i use :
<?php list_tags(); ?>
in my footer to show tags cloud
but not working
plz help me
Si
(@s872)
I am using the following code in my sidebar to show the list of tags with count for each.
<?php
$tags = get_tags( array('orderby' => 'count', 'order' => 'DESC') );
foreach ( (array) $tags as $tag ) {
echo '<li><a href="' . get_tag_link ($tag->term_id) . '" rel="tag">' . $tag->name . ' (' . $tag->count . ') </a></li>';
}
?>
Is there a way to have only the top (for example) 15 tags to show in this list with a link below the tags to a page where I will show all my tags in a specific format, e.g. cloud.
Cheers,
Simon.