Control child categories in WP 2.1
-
Prior to 2.1, I set my sidebar to display only categories 2, 3, and 4, each of which has so many children that I don’t want them to show in the sidebar. Instead each of these has its own category page (e.g., category-4.php) that lists all the children as links. (Category 1 was uncategorized, so I excluded it completely.) The old code:
<?php wp_list_cats('exclude=1&children=0'); ?>
With 2.1, I find that wp_list_cats is deprecated. I’m trying to get the same effect with wp_list_categories but am coming up short.
wp_list_categories('title_li=&show_count=0&child_of=0&hierarchical=0&exclude=1');
displays the children of categories 2, 3, and 4 but not the categories themselves.wp_list_categories('title_li=&show_count=0&child_of=0&hierarchical=1&exclude=1');
displays the parents (2, 3, 4) and the children.wp_list_categories('title_li=&show_count=0&child_of=0&exclude=1');
(which leaves out ‘hierarchical’) also displays both parents and children.I’m sure I’m overlooking something obvious, but as you can see it’s not obvious to me.
This is the site: Cousin Agam Fhèin
- The topic ‘Control child categories in WP 2.1’ is closed to new replies.