Wordpress Plugin: Category Link Manager
Posted on October 15, 2006 by Garrett MurpheyWordPress
I can't really call this a new plugin. If you look under the hood, most of codebase is just a reworking of the popular Page Link Manager. It's one of the nice things about Wordpress plugin development -- being able to borrow ideas from similiar plugins -- and it's what makes scripting for Wordpress enjoyable.
The motivation behind this plugin is the fact that excluding categories is somewhat of a barrier to those of us who are not programmers. It used to be that we would have to dig through PHP templates and add exclude=2,7 to the wp_list_cats tag. To clients or anyone not familiar with the Wordpress system, that may seem like an impossible task. And, for those who are comfortable with the Wordpress system, it can be just plain annoying. The Category Link Manager attempts to make things just a little bit easier.
One last note: I'd like to thank Valerie for sharing this idea with me.
The Plugin
The Category Link Manager Plugin is a Wordpress plugin that adds an administration panel that allows users to pick which category links are included in the site navigation. It also provides a function that uses these settings to replace wp_list_cats. Adding it to your Wordpress installation is as easy as ever.
- Download and unzip the plugin archive.
- Place the plugin file under wp-content/plugins directory on your Wordpress Installation.
- Log in to your admin interface and activate Category Link Manager under the 'Plugins' tab.
- Go to the new panel under the 'Manage' tab called 'Category Links'.
- Select and update the categories you want included in your site navigation.
- Open the source of the template file where you call the wp_list_cats function (the default file is sidebar.php, however it may be different if you're using certain plugins) and replace it with gdm_list_selected_cats.
If you're wondering, gdm_list_selected_cats is what does all the work for us. It takes the categories we chose to include in the navigation and works out what categories it should exclude. Besides that, it acts exactly like wp_list_cats -- it even takes the same parameters.
Here's a few examples of what we can do:
-
// sort the categories by name
-
gdm_list_selected_cats('sort_column=name');
-
-
// sort the list by name and show empty categories
-
gdm_list_selected_cats('sort_column=name&hide_empty=0');
-
-
// sort the list by name and manually exclude
-
// additional categories
-
gdm_list_selected_cats('sort_column=name&exclude=2,7');
Like my other Wordpress plugins, I hope to keep this plugin going as a work in progress as it helps make content management just a little bit easier. If you have any problems, questions or suggestions, please let me know.
Requirements
The current release requires a server running at least PHP4. The plugin has been tested on Wordpress 2.x. If anyone has gotten it working on older versions of Wordpress, please let me know.
Download the Plugin
All source code is provided under the Creative Commons Attribution-Sharealike License. If you agree to these terms, please download the plugin now.

13 Responses to
“Wordpress Plugin: Category Link Manager”
This is great--I got it working. Thanks so much!
By way of clarification, if you're using sidebar widgets, the category widget is included in the default widgets/widgets.php file near the end. You can find the place for the new function in this bit of code (shown edited for use with this plugin):
Thanks for sharing that Valerie -- it's always nice to see my plugins play nicely with others.
[...] [Download] [Plugin Page] [...]
Very nice.
Would it be possible to adapt this so that it could use gdm_list_selected_cats-1, gdm_list_selected_cats-2 etc. as snippets so that different categories could be displayed on different parts of the page?
not sure if i missed something, but i followed the instructions and it doesn't appear to be working. I'm using this to display my categories as the site navigation on all pages and it only says "No Categories". Help?
Hi Richard:
That sounds like an awesome idea. However, I don't think it's possible to do with the plugin as it is now. If there's enough interest, I'd be happy to try to work it into a future release. If you're looking for a way to do it right now, I'd suggest using wp_list_cats() and excluding the categories manually.
Hi Stefan:
Make sure you have at least one category selected to be displayed or you will get 'No Categories'. Also, by default, if there are no posts in an category, the category will not show up in the listing.
Hi! Very nice site! Thanks you very much! moov8tfLPDy
[...] Category Link Manager 0.1 Adds admin panel to choose which categories appear in the site navigation. [...]
[...] Garrett Murphey » Wordpress Plugin: Category Link Manager [펌] 심플한 ??트박스 효과 (?미지, 아?프렘, html 지?) » feed [...]
[...] Visit [...]
Hello! Good Site! Thanks you! exclifnpttiq
I use both your Manage Page and Category plugins extensively. Great stuff. I have recently started using the Fold Page plugin and was delighted to see that your Manage Pages plugin was designed to work with that. I was hoping that you are planning on integrating Manage Category and Fold Category in the same way?
Анализ игры - Бесплатная информация о системе игры в интернет казино. Вы узнаете, как выиграть в интернет казино. Вы будете играючи зарабатывать 50 $ ежедневно. Можете начать уже сегодня! казино онлайн, казино метелица, набор покера, эротический покер