Displaying Only Child Categories of Parent
-
Hi,
I’m using WP 2.0.x and I am trying to only display a child category when the user clicks a specific parent category.
Now the variable which holds the current category is $cat and when I echo it out it works fine. But when I use it in my code it ignores the variable and doesn’t display my child categories at all.
Works: wp_list_cats(‘sort_column=id&optioncount=0&use_desc_for_title=0&child_of=2’);
Doesn’t work:
$cat=2;
wp_list_cats(‘sort_column=id&optioncount=0&use_desc_for_title=0&child_of=$cat’);Can someone shed some light on this? For something that looks so simple this is driving me insane.
Thanks,
G.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Displaying Only Child Categories of Parent’ is closed to new replies.