タグをリンク付きでリスト表示

<ul> 
           <li>タグ</li>
         <?php
$tagList = $wpdb->get_results($wpdb->prepare("
    SELECT t.term_id,t.name,t.slug,tt.count
    FROM $wpdb->terms AS t
    JOIN $wpdb->term_taxonomy AS tt
    USING(term_id)
    WHERE tt.taxonomy = 'post_tag'
    ORDER BY tt.count DESC
"));
foreach ($tagList as $value):?>
<li>
<a href="/?tag=<?php echo $value->slug; ?>/">
<?php echo $value->name; ?></a> 
(<?php echo $value->count; ?>)</li>
<?php endforeach;?>
         </ul>