Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Talk:Function Reference/list cats

I believe the categories parameter is only used internally during recursion and cannot be supplied by the user. Am I wrong? --MDAWaffe 04:04, 4 Feb 2005 (GMT)

Good catch. You know, it would be nice if at least some of the documentation taken off the old wiki was correct...(slight exaggeration)...Looking at the function, I have to assume this had a different purpose at some point in the past. As I can't see what effective value it can hold besides 0, why else allow it to be passed as an argument now?!
~sigh~ Off once again to explain you can only use one specific value for a "user" parameter... -Kaf 06:57, 4 Feb 2005 (GMT)

Also recurse is backward. 0 echoes (and is default), 1 returns. --MDAWaffe

Will be fixed. Thanks. (Cool how I can post two replies at once---multi-tasking!) -Kaf 06:57, 4 Feb 2005 (GMT)
Looks like your multitasking needs work :) I'll fix recurse. The categories parameter is used only when the function calls itself in order to do the hierarchical magic. It doesn't take simple arrays, it takes complicated $wpdb->get_results objects. I'll say something about that on the page, but you might want to edit it later if it's unintelligible or pointless to include. --MDAWaffe
The multitasking merely needs to avoid (even basic) issues of logic at 3 in the morning. Thanks again.
As for categories, it's an argument for whacking the db query, and who exactly was asking for that? For the few like this, it's useless crowding of a parameter list. But from the perspective of end user documentation, explaining what it does isn't the issue; it's having to describe a setting you cannot set. In that case, there's no purpose to it, and needs to be admitted to in some fashion. -Kaf 14:46, 4 Feb 2005 (GMT)

More Examples Needed

I don't know if this or wp_list-cats is the right one to use, but either way, we really need some more examples on this tag. Examples of including and excluding categories, dealing with "children", and so on. Lorelle 02:54, 22 Feb 2005 (GMT)

Which is better?

Okay, what's the difference and which is better: wp_list_cats or list_cats? Will one be deprecated? Why do we have the two? Lorelle 22:36, 5 Mar 2005 (UTC)

I discovered that I could get wp_list_cats to display feed URLs (feed=xml), but I could not do so for list_cats, so for me wp_list_cats is better.Luhmann 21:03, 20 Mar 2005 (UTC)

There is no functional difference between the two tags. The only difference is in the way in which parameters are passed to the tags. See Template Tags/How to Pass Tag Parameters. There are two because when writing fairly complicated code (plugin developers, etc.), it is easier to interface with list_cats, but humans (you and me) find it much easier to work with wp_list_cats. One is easier for computers, the other is easier for people. So there's two for programming reasons, not for end user reasons. --MDAWaffe - Talk 21:37, 20 Mar 2005 (UTC)
Ahem. Neither is going anywhere... -Kaf 22:14, 20 Mar 2005 (UTC)

Notes on Use

I think this is a great place to put this info, Kaf. Can we put it above Parameters as it is applicable to the most basic use before you get to the specific customization? Lorelle 16:46, 22 Mar 2005 (UTC)

I was following a certain logic on where I placed it, but it does fall *emotionally* before parameters. So moved. -Kaf 01:11, 23 Mar 2005 (UTC)

You are a star! And consider "emotionally" - the panic in a user as they scramble to figure out how to use the tag. ;-) Lorelle 05:13, 23 Mar 2005 (UTC)

Tag documentation format

Hi, new to WP, just getting my bearings. Needed to use this tag and found that if it had been given to me int he following notation it would have saved me a headache ;)

list_cats(
	FALSE, 	// optionall
	, 	// 'all'
	'ID',	// 'sort_column'
	'asc', 	// 'sort_order'
	, 	// 'file'
	FALSE, 	// list
	FALSE, 	// optiondates
	FALSE, 	// optioncount
	FALSE, 	// hide_empty
	TRUE, 	// use_desc_for_title
	FALSE, 	// children
	FALSE, 	// child_of
	, 	// 'categories'
	FALSE, 	// recurse
	, 	// 'feed'
	, 	// 'feed_img'
	'1,33', // 'exclude'
	TRUE	// hierarchical
	);

Cheers. :) User:Bupoc

Example from Mapored deleted in article

<?php list_cats(1, 'all', 'name','asc', , 1, 0,1, 1, 0,1, 1,'Categories',0,'feed','feed_img','exclude',0); ?>