I want to display on children categories name of a particular category

Go To StackoverFlow.com


I want to display only children categories of a particular category. Suppose I have a category "city" and its children categories are "london" and "new york".

I want to display these children by mentioning parent's name.

Searched codex on wordpress website but not helpful. Please help me. Thanks in advance

2012-04-03 19:49
by Anil Tiwari


This is what you're talking about isn't it? http://codex.wordpress.org/Template_Tags/wp_list_categories pay particular attention to 'child_of' parameter to select (the id) of your parent category.

2012-04-03 19:52
by mikevoermans
am sorry, the id is tag ID of the category - Anil Tiwari 2012-04-03 19:59
Yes, I believe that will do the trick - you should be able to find it in the URL of the admin panel, as well as a couple other areas I'm sure - mikevoermans 2012-04-03 20:01
I have written a line of code and the ID of that particular category is 3.

but it doesnt show anythin - Anil Tiwari 2012-04-03 20:04

wplistcategories(array('child_of' => 3)) - mikevoermans 2012-04-03 20:07
OMG, what a silly mistake I did. Thanks a ton mikevoermans : - Anil Tiwari 2012-04-03 20:14
No problem, I assume that means my answer worked and you accept it ; - mikevoermans 2012-04-03 20:16