I changed the coding around a bit to add a Home tab, but I’m still getting the same results.
<?php
$catList = explode('<br />', wp_list_categories('echo=0&show_count=0&title_li=&style=none'));
foreach ($catList as $cat)
{
$iPos = strpos($cat, '>');
if (is_home()) {
$addclass = ' class="current_page"';
} else {
$addclass = '';
}
echo "<li" . $addclass . "><a href='" . get_option('home') . "' title='Home'><span>Home</span></a></li>";
elseif (is_category()) {
$addclass = ' class="current_page"';
} else {
$addclass = '';}
echo "<li" . $addclass . ">" . substr($cat, 0, $iPos) . '><span>' . substr($cat, $iPos + 1) . "</span></li>";
}
?>
The tab for Home works great. On the main page all of the category tabs show up correctly, but if I click on a category all of the category tabs become highlighted instead of just limiting it to the clicked one. Plus I’m still getting this extra snipet of code that shows up at the end every time (even on the main page).
<li class="current_page">><span></span></li>
</ul>