I have a wp-based website for an online shop. The items are listed as posts, the navigation is based on categories. For parent category pages (archive.php), I want to have the children categories listed as links. I don't want to code every parent page individually (child_of=x). I've found the following code, but there seems to be an error somewhere, as not only the children categories are listed, but all of the website's categories.
<?php
$children = wp_list_categories('title_li=&child_of='.$category->cat_ID.'&echo=0');
if ($children) { ?>
-
<?php echo $children; ?>
<?php } ?>