I just noticed that my calls to wp_list_categories() in my menu bars isn't working as expected.
The WordPress documentation says that it should automatically add class='page_item' or class='current_page_item' to list elements, but I'm getting nothing. I hope I'm not missing something stupid, but I've spent a while poking at it, and rummaging around in the WP supprot forums.
Could somebody check this out for me? Here's my menubar code:
<ul id="menu">
<li class="<?php echo($sMenuHome); ?>"><a href="<?php echo get_settings('home'); ?>/"><?php _e('Home', 'gluedideas_subtle'); ?></a></li>
<?php if(count(get_all_category_ids())<3) {
} else { wp_list_categories('sort_column=id&depth=1&title_li=0&exclude=1');} ?>
<?php wp_list_pages('sort_column=menu_order&depth=1&title_li=0'); ?>
</ul>
And here's what it outputs (abbreviated):
<ul id="menu">
<li class="current_page_item"><a href="*">Home</a></li>
<li><a href="*" title="A category for class logs.">Class 1</a>
</li>
<li><a href="*" title="Another category for class logs.">Class 2</a>
</li>
<li><a href="*" title="A log for a third class.">Class 3</a>
</li>
<li><a href="*" title="View all posts filed under Events">Events</a>
</li>
<li class="page_item"><a href="*" title="About">About</a></li>
<li class="page_item"><a href="*" title="Resources">Resources</a></li>
<li class="page_item"><a href="*" title="Calendar">Calendar</a></li>
</ul>
As you can see, the items generated by wp_list_categories() are plain old li's with no class added at all. I've tried this with several themes, and also a raw
<?php echo wp_list_categories('sort_column=id&depth=1&title_li=&exclude=1'); ?>
at the top of a blank page with the same results.
Am I missing something?