Sorting tags by name

Question

I’m displaying a lit of tags when they have a description. I’d like to sort them by name instead of by post quantity. Is there a way to do this?

<?php 
    $tags = get_tags();
    if ($tags) {
      foreach ($tags as $tag) {
        if ($tag->description) {
          echo '<dt><a href="' . get_tag_link( $tag->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $tag->name ) . '" ' . '><h3>' . $tag->name.'</h3></a></dt><dd style="margin-bottom: 10px;">' . $tag->description . '</dd>';
        }
      }
    }
?>
0
Zach Shallbetter 4 months 0 Answers 13 views 0

Leave an answer