Welcome to Dagon Design. In addition to free scripts, WordPress plugins, and articles, we offer a variety of services including custom theme design, plugin creation, and PHP scripting. Contact me for more information.

Version 1.3   Updated Friday, February 20th, 2009 at 7:19pm

Multi Column Category List Plugin for WordPress

This plugin generates an alphabetical listing of your WordPress categories in multiple columns. You can choose the number of columns to display, with an option to split up the list of categories by letter. It also supports the use of a custom header to help separate the categories. For example, you could have it say ‘Topics: A’ and then list the topics that start with ‘A’, etc. The category list can easily be added to any post or page with the trigger text, or called directly from a template file. A CSS file is also included for easy style changes.

Related Plugins

There is also a plugin available to generate a multi-column list of your WordPress links.

Download

  If you have found this page useful, please consider donating. Thanks!

Installation

  • Download the above file and uncompress
  • Upload dd-multi-col-cats.php to your plugins directory
  • Upload dd-multi-col-cats.css to your theme directory
  • Activate the plugin from the WordPress admin panel
  • Configure the options under the admin panel: Options – DDMultiColCats

Usage

To use this plugin, simply add the following trigger text to a post or page:

<!-- multicolcats -->

If you prefer, you can also call the function directly from a template file with the following command:

<?php echo ddmcc_generate(); ?>

Change Log

  • 09-29-07 Version 1.3 – Updated for WordPress 2.3. Added ‘Load Default Options’ button. Removed javascript expand code because it was too buggy.
  • 05-16-07 Version 1.2 – Updated for WordPress 2.2.
  • 03-02-07 Version 1.1 – Option added to allow click-to-expand lists. Special thanks to Richard K Miller for submitting the code!
  • 02-03-07 Version 1.0 – First release.

Options

Here are the options available for this plugin under the WordPress admin panel

Number of columns

The number of columns that the categories will be shown in. If you want to show more columns than your layout width will handle, you can adjust the width of each column in the CSS file.

Separate items

Here you can choose to separate the categories by letter, with a custom separation header, or no separation at all.

Separation header

If the separation option is enabled, this is where you enter your separation text, which will be shown above each set of items. You can use %L to show the letter. For example, if you enter Topics: %L then it will show Topics: A, (list of cats), Topics: B, (list of cats), etc…

Excluded categories

This is a comma-separated list of the category IDs you want to exclude from the list.

  1. Hey Its Easy
    But You Need to Modify It If You Wanna Have the Click on Letter and Scroll Down Feature Contact me on my Site and Leave a Comment in the Request Page I will Give You My Version of This Wonderfull Plugin!
    Anime-Exceed.com

  2. 126
    doodle

    Hi I’m having problems with the plugin. I can’t seem to get this to work in my sidebar “categories”. What do I do?? I’d also like to remove the letter header. Can somebody help??!! Maximum frustration levels :P

  3. I have installed your plugin and really its nice one. I have many categories and sub-categories and needs to display the sub-categories under each main category.

  4. Looks great! Am planning to install it on one of my sites. Is it compatible with the latest version, 2.9.2?

  5. 123
    cyber69

    http://tinyurl.com/ctz88y

    i have found this site using this plugin, but they have extra feature that if i click any letter of from header i scroll down auto to the alphabetical list. how can i make this one.

  6. I have installed your plugin and really its nice one.

    I have many categories and sub-categories and needs to display the sub-categories under each main category.

    Please let me know how to do this.

  7. Really nice plugin. Thank you for sharing.

  8. 120
    tobi

    hi, very nice plugin. good job! is there a way to do the same thing for the wp_get_archives stuff?
    thanks tobi

  9. Thanks for the plugin! I plan on adapting your idea to extend my website features …

  10. 118
    Tsuki

    It’s working but I can’t make the column have an equal number of categories. I mean, I get 10 category names on the left and 3 on the right. How to get them even? Thanks.

  11. 117
    James

    Is there any way you can use this in two separate instances on your site, but with different settings?

    e.g. I want to display categories in 2 columns in my sidebar, and in 3 columns in my footer.

  12. Great plugin, thank you for that! But is there a chance to show the number of posts after every category? Like “Apples (5), Lions (134), …”? That would be so awesome!

  13. Hey, great plugin! Just what I was looking for.

  14. i am using this great plugin from last 6 months and working fine.
    but
    there is problem in 2 columns. only 1 is displaying and second is not.

    any guide to fix this problem?

    here is the site
    http://models.femalemodels-hq.com
    latest wp 2.9.1

  15. 113
    dbluesky

    mehs. i can’t get it to work despite following the instructions :(

  16. Great plugins.thanks

  17. Hi there. Great plugin! I have parent categories as ‘Destinations’ and child categories as things within those destinations, e.g. ‘Restaurants’, ‘Bars’. Is there any way to only show parent categories? Thanks.

  18. i like this plugins. is very suitable for making web directory. thanks

  19. Hello, first thanks for the plugin.
    I need to show empty categories too, how can i doit?
    Thanks

  20. 108
    Echio

    Is there anyway in adding Alphabetical link on top that jumps to the letter that was clicked on??

  21. very good plugin!! thank you for sharing!

  22. Great plugins. That’s is what i’am looking for so far. thanks

  23. thanks a buch!! is it possible to prevent displaying the same letter continued on the next column?

  24. 104
    mark

    Hello and thanks for the great plugin.. Is there a way to add code to where the plugin will ALSO show links to all the posts UNDER each of the categories? Maybe with each post being indented with a ?

    Mark

  25. 103
    Matthew

    Can this plugin be configured or updated to list tags in a multi-column layout?

  26. 102
    guest

    Hi, I was just wondering – is it possible to use two instances of this plugin with different options set for each instance?

  27. Okay, is seems good

  28. 100
    Dennis

    Hello, I’ve seen websites using something like What is that?

  29. Is there any way to use this plugin to display pages instead of links or is there a way to use the site map plugin, but display in columns? I read through all the comments and it doesn’t look like it was answered…

    Any help?

  30. For those wanting this plugin to display header numbers as well as letters. We have modded the code. Please be aware that this will require CSS for styling. Just change lines 221 – 259 to the following:

    
    LINE: 221
    VERSION: 1.3
    
    for ($c = $start_cat; $c < $end_cat; $c++) {
    
    			if ($sep != 'no') {
    
    				if ((strtoupper($cat_list[$c]->cat_name[0]) != $last_char)) {
    
    					$last_char = strtoupper($cat_list[$c]->cat_name[0]);
    
    					if ($sep_header != "") {
    						if ($sep == 'header') {
    							$tmp_header = str_replace("%L", strtoupper($last_char), $sep_header);
    							if (!$first_item) {
    								$t_out .= "";
    							}
    							$t_out .= '<p class="sep">' . stripslashes($tmp_header) . '</p>';
    						} 
    					} else {
    						if ($first_item) {
    							$first_item = FALSE;
    						} else {
    							$t_out .= '<p class="sep">&nbsp;</p>' . "\n";
    						}
    					}
    
    				}
    
    			}
    
    			$t_out .= '<li><a href="' . get_category_link($cat_list[$c]->cat_ID) . '">' . $cat_list[$c]->cat_name . '</a></li>' . "\n";
    
    			if ($first_item) {
    				$first_item = FALSE;
    			}
    
    		}
    
    		$t_out .= "\n</div>";
    
    	}

  31. FIXED CODE:

    copy and replace the whole item as specified and then just delete the {- rel=”nofollow} section in the second statement. everything works fine!

    check it out:

    http://www.ttmyt.com
    http://www.thoughtsthatmakeyouthink.com

  32. to the admin:

    I tried to use your code in the file, but i keep getting an error when i save and load in a browser… can you help?

    $tmpcat = get_categories (‘include=’ . $cat_list[$c]->cat_ID);
    $numposts = $tmpcat[0]->category_count;

    $t_out .= ‘cat_ID) . ‘”>’ .
    $cat_list[$c]->cat_name . ‘
    (‘ . $numposts . ‘) ‘ . “\n”;

    doesn’t work? syntex? missing something? spacing wrong? i give up after 1 hour!

  33. 95
    Pete

    I’d like to use this but within a widget. How can I do that?

  34. Like Theirs No (. or numbers) and i want it to be able to scroll down to the alpahbet wen i click E it should go to E and so on….

  35. Uhm doods Can you like Add The Older Version of this plugin…

    Or Can You Tell me Whats Wrong With The Plugin Here Check it out!

    http://anime-exceed.com/anime-list/

  36. 92
    mushtaq

    Hi
    1st of all Thanks for the wonderful plugin.
    next is how do i add post count in front or each category linke
    uncategorized(2)

    Thanks a lot if u can help me out.

  37. Hello,
    I find no demo of this plugin. Surprising?, can you post at least one link where we can see what the plugin does?

  38. Is there a way to make the title tag the WP category description instead of the category title?

  39. 89
    robert

    any chance there’s an easy hack to do the same kind of multi column list, but for the blog authors instead? i have a multi-author blog running on wp 2.7.1 with over 60 authors and growing… your help is much appreciated.

    robert

  40. Thanks for sharing this wonderful plugin.

  41. Is there a way I can use the plugin at http://wordpress.org/extend/plugins/category-icons/ to display icons next to my category listings in my list?

    Thank you, by the way. Awesome plugin!

  42. lugaluda.com: Try this. Find this line in the script:

    $t_out .= '<li><a href="' . get_category_link($cat_list[$c]->cat_ID) . '">' . 
       $cat_list[$c]->cat_name . '</a></li>' . "\n";

    and replace it with this:

    $tmpcat = get_categories ('include=' . $cat_list[$c]->cat_ID);
    $numposts = $tmpcat[0]->category_count;
    
    $t_out .= '<li><a href="' . get_category_link($cat_list[$c]- rel="nofollow">cat_ID) . '">' . 
       $cat_list[$c]->cat_name . '</a> (' . $numposts . ') </li>' . "\n";

    You can see where $numposts is added to the output, and customize as you like :)

  43. Hi, Is there a way to display the number of posts for each category?

  44. This plugin has been tested, and works, in the latest release of WordPress – 2.8

  45. Hi,
    Nice plugin. How to display sub-category under its parent category as now it show sub-categories as main categories.
    Thanks.
    Hum

  46. 82
    Maja

    Plugin doesn’t work with 2.8 . Can you solve this issue?

  47. 81
    paul

    thanks alot, i have been trying to get all the categories in a non-rubbish ordered list, and just in an array but didnt know the sql, now i have my meta box category list, thanks alot.

  48. 80
    Echo

    Thank you so much for this. U ROCK

  49. Could this plugin work for pages, and what about child pages? any advice would be amazing. you da best!

  50. The column behavior did not worked. Is there a problem?

  51. Thanks for shaing, I will certainly buy the plugin, would like to see some videos or pictures, sounds promising though, I have seen it in other blogs, would like to see the admin panel though..thanks..cool plugin

  52. any chance you’re putting out a version where we can select to show all child categories of a parent category like the child_of function? If not, can you tell me how to hack the plugin file. That would be so amazing and I’d really appreciate it. Thanks for all your hard work on your plugins!

  53. hi,
    there is a great plugin, but I have a problem:
    do not work with the WP Security Scan 2.4 plugin active.

    many thanks and sorry, I no not speak english

  54. 74
    Anthony

    Help, I can’t get this plugin in to work. I’am using WP 2.7.1. I’ve tried both ways of usage, by shortcode (HTML edit view) and by direct template tag, but with no luck. All i get is an empty DIV and ULs. Is there any reported issues this plugin not working with other plugins installed?

  55. 73
    Aldi

    Do you have a working example?

  56. 72
    chris

    how do i make it show empty categories, that havent been posted too yet. i want to show all of them, not just the ones that have been posted too

  57. 71
    Mihai

    hey..great plugin first..
    how to show the columns one next to eachother, cause now it puts them one under the other..and i want them next to eachother

  58. Hi! I have downloaded this plugin and tested it. But in the list, it shows up some categories that I don’t use. How can I hide them? I tried several ways, but I am unable to hide them. Any help would be great, thanks!

  59. Nice plug-in.

    Remember to post using HTML and not visual.

  60. This plugin has been tested in the latest release of WordPress (2.7.1)

  61. Hi,
    is it possible to show parents and childs?
    Thanks a lot for the very nice plugin.

  62. Forgot to add, it would also be nice to have an option to “display the # of posts in each category” =P.

  63. Hi, for WordPress 2.7, the Categories for Letter “G” is divided into two (via 2 column listing).

    I don’t know if you meant to do that or not but i’m just reporting so you would know.

    O.K. I’ll try to hack it now, so that the categories listed under “G” doesn’t divided into 2.

  64. After a few failed attempts the plugin installed. Thanks a bunch.

  65. I have Wordpress 2.7 and I tried installing your plug-in but the installation keeps failing. I’ve used your plugin on another site and really enjoy the functionality of it. Do you have any plans to make in compatible with the new version of Wordpress?

  66. Nice work thanks

  67. Nice plugin , this will be on my toolbox of wordpress :)

  68. 60
    danielle

    thanks! now i can sleep.

  69. Good job plugin for wordpress.

  70. This plugin is great! But, when works to wp-2.6.2?

  71. 57
    Rade

    hello,
    does anybody find way to show only child_of some category id?

    thanks

  72. Great plugin. I am wondering if there’s a way to add the RSS link for each category beside the category name?

  73. 55
    Sadik

    Hi Friedns,I have used this plugin in my site and i wanted to create categeory list in Column so i used that trigger text(), and the function directly, but it is nt working.
    Can anyone help me to solve this problem …… ??
    And one more thing is that to use this plugin,is that necessary to use another plugin XML Site Map Generator to work MCCL plugin ??

  74. Hi have tested it in wordpress 2.51 and it works, when you call switch the post format from view to html. THen add this should do the trick.

    Hope this helps

    Bradd

  75. 53
    Peter Lurie

    Unable to get this to work in 2.5.1

    I have tried using the trigger text, and the function directly, but no go.

    Weird, because multicollinks DOES work! Any ideas?

  76. 52
    Not Working

    Hello

    I have installed this plugin but it looks like is not working for the latest version of wordpress.

    I have tried everything, but my efforts was in vain :(

  77. This is a cool plugin, I am going to use it to my blog.

    Jeff
    http://www.ScriptsAhead.com

  78. 50
    Rade

    Hello, thanks for this great plugin, i will use it on my website just i have one simple problem.

    1. Where in code to add the line to see all the categories even they are empty. i tryed update_option(‘ddmcc_hide_empty’, ‘0′); but doesnt work.

    2. And also it would be great if you have idea how to change color of empty categories if you add them on list.

    Thanks for the answer!

  79. This plugin sounds like just what I need. I am going to download it and give it a shot. It would be cool if you had a link to sample output of this plugin to illustrate exactly what the end result looks like. Look forward to giving it a shot. Thanks,Richard

  80. GREAT plugin! Is there any way to adapt it to show all the tags in columns to make a tags archive? There used to be an add on for Ultimate Tag Warrior (link) that used to do the trick, but it was never updated to the newer WP versions… it’d be really cool if this plugin was adaptated for that!

  81. This is a cool plugin and I am using it on my site.

  82. This plugin is great! I too would love to know how to show post count next to the category, everything I have tried so far hasn’t worked.

    thanks

    Joe
    http://www.IMwithJoe.com

  83. DD it would be really great if it were possible to show category and subcatgories as well! I’ve been searching for this kind of feature for ages, just like in the babycenter site for example :
    http://www.babycenter.com/baby?intcmp=Nav_Global_Baby_v3
    Anyway, thank you so much for all those great plugins :)

  84. This is an extremely handy plugin. Thank you very much. You should consider making this into a widget since many people are going to use this in their sidebar.

  85. When I attempt to change the number of columns, I receive the following error:

    Fatal error: Cannot redeclare ddmcc_add_option_pages() (previously declared in D:\Inetpub\jonathangriffith\wp-content\plugins\dd-multi-col-cats.php:21) in D:\Inetpub\jonathangriffith\wp-content\plugins\dd-multi-col-cats.php on line 24

    Any idea?

  86. Would there be a way to adapt this for tags?

  87. Is there a way to use this plug-in for pages.

  88. 40
    justagirl

    I saw this asked in comment #27, but didn’t find an answer… is there a way to edit the code so that the number of posts per catagory is displayed to the right of the catagory name? A “find/replace” type of answer would be greatly appreciated! Otherwise, this plugin is EXACTLY what I needed. Thanks for offering it! =)

  89. See those two commands? I tried using them both with the links template. I tried using the multicolcats one with archives template. no attempt worked.

    I uploaded the plugins to the plugin directory, I uploaded the CSS files to the theme directory, didn’t work. I am not a happy camper. You need to write complete instructions, and I do mean complete. And that includes the Sandbox theme and any design for same.

  90. You use this with which page template? It is necessary information.

  91. This is a cool plugin – I am using it on my site, but I have a question…some of my categories start with a number, so does anyone know how to get numbers included along with A,B,C,D etc…?

    Any tips would be much appreciated – cheers everyone!

  92. 36
    Kasper

    The comma separated excludes doesn’t work! I did this:
    // Set defaults if options do not exist
    add_option(‘ddmcc_num_cols’, 2);
    add_option(‘ddmcc_sep’, ‘header’);
    add_option(‘ddmcc_sep_header’, ‘%L’);
    add_option(‘ddmcc_exclude’, ‘1′);

  93. Wondering if it could be modified to include only 1 specific category?

  94. Hi, again would really love if we have an option to display/not display the “cat description” for each category (cuz the SE isn’t too fondly of a page with tons of links =).

  95. Would love to have this type of code to display posts alphabetically. What’s the chances of getting this type of simple code for a page.

  96. I have to You a strange question: In which application You made logo degondesign. Thamk’s for answer.

  97. This plugin help my order my comments. He is great. Thank’s

  98. Cool plugin, i am going to install on my blog now.

  99. Version 1.3 Released

    This version adds support for WordPress 2.3, and a ‘Load Default Options’ button has been added to the options page. The Javascript (click to expand) feature has been removed, due to problems with it.

  100. i have been looking for something like this for a long time! thanks for this wonderful code

  101. 27
    MFrazier

    I love this plug-in, but I am curious how I would edit it to output the number of posts in that category to the right of the category name.

    any ideas?

  102. This plugin looks perfect for something my dad’s been asking for on the website I manage for him… but I’m having a problem with it. I installed the plugin and configured options as instructed above, and then created a page containing just <!-- multicolcats -->. When I view the page, the list appears for a split second and then vanishes. I have no idea what would make that happen — can you help? The URL is http://www.familypoet.com/poems-by-category/ – thanks!

  103. WordPress database error: [Can't find FULLTEXT index matching the column list]
    Hi,
    First I want to thanks for this nice nice plugins

    But I got onje problem in my blog.
    I got this error :-

    SELECT ID, post_title, post_content,MATCH (post_name, post_content) AGAINST (‘blode 134′) AS score FROM wp_posts WHERE MATCH (post_name, post_content) AGAINST (‘blode 134′) AND post_date

  104. Wow! Here’s the script I’ve been looking for in your sitemap generator although it would be nice if the categories can be arranged exactly as they can be in the sitemap generator instead of alphabetically.

    Like:
    Category A
    – Subcategory1
    – Subcategory2
    Category B
    – Subcategory1
    – Subcategory2

    This is pretty nifty, though. Great work!

  105. Thank you so much for creating this! I tried to do this on my own, and it just wasn’t working out right. This plugin lets me do exactly what I wanted!

  106. we have an working example running on http://www.cmssolutions.nl
    Feel free to have a look at the way it is integrated.

  107. Can anyone offer an example of this in action?

  108. 20
    kate

    Of course I meant to ask the previous question under the multi column Link List Plugin. Sorry.

  109. 19
    kate

    Hi,

    Nice idea!
    Do you know how i could do the same thing with posts rather than links?

    Thank you!
    Kate

  110. Thanks for the cool plugin

  111. 17
    Michael

    Nevermind. Got it to work. Nice plugin.

  112. 16
    Michael

    Would it be difficult to modify this to pull in category descriptions under the category names? This is something of a big shortcoming in WP, IMHO.

  113. Chris: It cannot do that currently.

    Spencer: You can add extra code at the end of the plugin output by appending it to the $t_out variable, which is returned in the function which generates the output.

  114. 14
    Chris

    Love the plug-in, exactly what I needed. Is their a way to display sub-categories under their parents? thanks

  115. This is an extremely handy plugin. Thank you very much. You should consider making this into a widget since many people are going to use this in their sidebar. I took a crack at it but failed.

    Also, I seem to be having an issue with clearing when using this. It is obviously my markup that is causing the problem, but if you have any info on how or where a clearing div should be added, I would appreciate it.

    Thanks again.

  116. [...] Multi Column Category list Plugin for Wordpress This plugin generates an alphabetical listing of your WordPress categories in multiple columns. [...]

  117. [...] Multi Column Category List genera una lista alfabetica delle vostre categorie wordpress, su più colonne. Il numero di colonne si può scegliere, e un’altra opzione permette di mettere in testa una categoria preferita. Compatibile con Wordpress 2.1, non testato con altre versioni. [...]

  118. Matt: Thanks for the new plugin – I’m excited to try it out. You plugin creators are the best!

  119. I just added a plugin which displays links in multiple categories as well. You can find a link to it at the top of this article under ‘Related Plugins’ :)

  120. I, too, have just a few categories, but many links and categories of links. I use a plugin now, but it gives me a very, very long single-column list… and it keeps growing! So a dd-multi-col-links plugin would be really useful. Your site mapping plugin is great!
    Many thanks.

  121. Miriam: Glad you like it. Categories and links are handled a bit differently, but it would be possible to make a plugin to do the same with links for sure. I will keep it in mind :)

  122. Would it be possible to hack this so that it applies to links (i.e. the blogroll) instead of categories? I tend to have more links than categories on my blogs, and it would be helpful to the readers if I could easily put them in columns. Anyways, this is a great plugin!

  123. [...] Multi Column Category List Plugin for WordPress This plugin generates an alphabetical listing of your WordPress categories in multiple columns. You can choose the number of columns to display, with an option to split up the list of categories by letter. (tags: wordpress plugin wp-plugins) [...]

  124. Thomas: Actually I do not, since I do not have that big of a category list and it would not show it off very well.

    If anyone out there is using this plugin, and would like a link to their site from this one (to act as a demo) let me know! :)

  125. Look’s like a great plugin. Do you have a live preview on your site somewhere?

  126. jochen: You upload it to the dir of the theme you are using.

  127. Hi,
    do i have to upload th css into the theme dir or into the the theme for example /classic?

    Jochen

Leave a Comment

Before you comment: If you are having an issue with a script, please make sure you have read the entire article. Also, please read through the comments because most common issues have already been discussed many times. Thanks.


Be sure to wrap all code in <code></code> tags.