For my footer, I wanted to list the top ten categories (as calculated by the number of posts in each category). Bizarrely enough, there isn't an easy built-in way to do this with Wordpress. What's more surprising is that I couldn't find a plugin that provided this functionality, either. Maybe I'm the only person with this requirement. At any rate, this is how I solved the issue:

  1. <?php
  2.  
  3. $top_cats = $wpdb->get_results("SELECT * FROM $wpdb->categories ORDER BY category_count DESC LIMIT 10");
  4.  
  5. foreach($top_cats as $cat)
  6. {
  7. $cat_link = '<a href="index.php"' . $cat->category_nicename . '">';
  8. $cat_li = "<li>$cat_link $cat->cat_name</a></li> ";
  9. echo($cat_li);
  10. }
  11.  
  12. ?>