After an irritating couple of hours fumbling about with the WordPress documentation, I came up with this fragment to draw the dynamic part of my left sidebar:
<!-- Begin - Links from the 'Links Manager'-->
<?php
$link_cats = get_categories('type=link&orderby=ID');
foreach ($link_cats as $link_cat) {
?>
<div class="left-widget-title"
id="linkcat-<?php echo $link_cat->cat_ID; ?>">
<?php echo $link_cat->cat_name; ?>
</div>
<div class="left-widget">
<ul>
<?php wp_list_bookmarks('categorize=0&category=' . $link_cat->cat_ID . '&orderby=name&title_li=0') ?>
</ul>
</div>
<?php
}
?>
<!-- End - Links from the 'Links Manager'-->
The assignment of the id= attribute to the widget title <div> is mainly there for debugging purposes.
Man oh man, it’s miserable work extracting information from the WordPress docs. And I’m not really happy about an app that breaks existing code every time a point release comes out. Oh well, it didn’t cost me any coin.
I used these doc pages: category, wp_list_bookmarks, and get_categories.