Hi Adsworth,
just tried your php and all the cats just disappeared so probably doing something wrong.
Am I supposed to change the file called sidebar.php and if so I change it from the following:
<!– ##### Left Sidebar ##### –>
<div class=”leftSideBar”>
<p class=”sideBarTitle”><?php _e(‘Pages’); ?>
<?php wp_list_pages(‘title_li= ‘); ?>
<p class=”sideBarTitle”><?php _e(‘Categories’); ?>
<?php list_cats(0, ”, ‘name’, ‘asc’, ”, 1, 0, 0, 1, 1, 1, 0,”,”,”,”,”) ?>
<p class=”sideBarTitle”><?php _e(‘Archives’); ?>
<?php wp_get_archives(‘type=monthly’); ?>
<p class=”sideBarTitle”><?php _e(‘Links’); ?>
<?php get_links_list(‘name’); ?>
</div> <!– leftSideBar –>
To this:
<!– ##### Left Sidebar ##### –>
<div class=”leftSideBar”>
<p class=”sideBarTitle”><?php _e(‘Pages’); ?>
<?php wp_list_pages(‘title_li= ‘); ?>
<p class=”sideBarTitle”><?php _e(‘Categories’); ?>
<?php
$child_of = 0;
$children = 0;
$cur_cat = $wp_query->get(‘cat’);
if(” != $cur_cat ) {
$child_of = $cur_cat;
$children = 1;
}
wp_list_cats(“children=$children&child_of=$child_of”);
?>
<p class=”sideBarTitle”><?php _e(‘Archives’); ?>
<?php wp_get_archives(‘type=monthly’); ?>
<p class=”sideBarTitle”><?php _e(‘Links’); ?>
<?php get_links_list(‘name’); ?>
</div> <!– leftSideBar –>
Can you spot the error I have made anyone? I am using a theme called Gila which is a three column one.
All help appreciated – or if anyone knows another way to create way of hiding cild catagories of posts and pages until the parent is clicked I’d certainly make a donation.
All the best
bob