I cannot figure out how to use the wp_list_categories function to do what I need it to:
<?php if(is_page('realisations')) { ?>
<ul id="subpage">
<li><strong>Les secteurs</strong></li>
<?php wp_list_categories('child_of=3&title_li='); ?>
</ul>
<?php }; if(is_category() or is_single()) { ?>
<ul id="subpage">
<li>Les secteurs</li>
<?php wp_list_categories('child_of=3&title_li='); ?>
</ul>
<?php }; ?>
I hope this doesn't come off as too convoluted. It does what I need it to do, despite not being very elegant. I have it set up so that all of the project categories are child categories of the a main category (child_of=3) This is to avoid conflicts with the news section of the site.
The problem is that I need the category the post is in to highlight when viewing the single.php page template, but I don't know how to accomplish that. When on a category page the category view highlights correctly because I styled the class that WordPress adds into the generated list .current-cat.
This is a crosspost from the normal StackExchange site, it was suggested that I submit the problem here.
current-catclass is only used when displaying a category page. As a post can be within multiple categories, this is harder to find out. Will do some checking... – hakre Nov 19 '10 at 19:59