I’m working on it! but I don’t know php so it’s going to take a while ??
heres my thoughts, hopefully some of it makes sense:
It would mean amending how <?php wp_list_cats(); ?> works…
Each category is allocated an ID, with category parent as 0
each sub category has a category parent ID other than 0.
By utilising this information it should be possible to allocate/autogenerate an id, or a class, to a category li tag. Preferably related to the current ID, so using the ID number might be useful.
In the main stylesheet, or an autogenerated additional sheet, you a add ul.children { display:none;}
which will hide all sub categories.
In the template you add some css to the header:
#ID.children{display:block}
where ID is also autogenerated and relates to the current viewed category ID <strong>or</strong> category_parent
so if you were looking at a category entitled 'About' with an ID of 10 which had a sub category entitled 'Access' with an ID 11. The generated markup would look like this:
<br />
<li id="categories">Categories:
<ul>
<li class="one"><a href="".../index.php?cat=1"" title=""All">Main</a> </li>
<br />
<li class="ten"><a href="".../index.php?cat=10"" title=""About">About</a><br />
<ul class='children'></p>
<li><a href="".../index.php?cat=11"" title=""Accessible">Accessible</a></li>
</ul>
</li>
<br />
the main style would have:
one.children, ten.children{display:none;}
the inserted css generated on the template would have the following, when viewing the relevant page:
ten.children{display:block;}
Is that as clear as mud? I’m hoping it isn’t and that conveys my thoughts on this.