Turns out its pretty easy to add a new category sidebar link in WordPress if you aren’t using a sidebar widget. For example, check out the new Useful link area that I’ve added to this site to list any articles I’ve written that may be considered useful.
To do this, I opened up the Sidebar template file (sidebar.php) and added the following lines:
<div id="blogroll"> <h3>Useful</h3> <ul> <?php get_links(17, '<li>', '</li>', ' - '); ?> </ul> </div>
I’ve used the same div id, blogroll as the blogroll link because I wanted to keep the same CSS formating. The key is the get_links function and working out the category ID.
17 is the category ID for the new Useful category which you can find out by going to Links > Link Categories in WordPress, clicking on your link category and looking at the URL which will be like this:
http://blog.praj.com.au/wp-admin/link-category.php?action=edit&cat_ID=17
So cat_ID=17, indicates that the link category Useful has a category ID of 17. Interestingly the blogroll category ID was 2, so not sure what happened to all the category IDs in between …