List Categories in Sidebar – WordPress
The code below will list categories in the appropriate format for your WordPress sidebar.
For this example, we exclude items from category 10. If you don’t want to exclude any categories, just remove &exclude=10. To exclude a different category, simply change the number 10 to the number of the category that you’d like to exclude.
<li class="widget">
<h3 class="widget-title">Categories</h3>
<ul>
<?php wp_list_cats('sort_column=name&optioncount=1&exclude=10'); ?>
</ul>
</li>
Posted April 4th, 2010 in Code Snippets.
