The code above is adding a class called “current” under certain conditions. It is not going to make any changes to the way the category is displayed (highlighted) until you set up some CSS to do so.
You do that in your theme’s style.css file.
For the above, something like
ul#nav_01 li.current { background-color: #fff; color: #FF0000; }
which makes a white background with red text
Thread Starter
modern
(@popart)
I already have the CSS in place. The above code does change the current category title correctly. But it’s not listing the other categories…. What am I missing to make the other categories display normally?
Thread Starter
modern
(@popart)
<li class="<?php echo $highlight; ?>"><a href="<?php echo get_settings('home'); ?>">Latest News</a></li>
The code above works correctly to highlight “Latest News”, but I’d like to replace “Latest News” with a dynamic menu so that it lists all categories and only highlights the current one…. Should be something like:
<li class="<?php echo $highlight; ?>"><a href="<?php echo get_settings('home'); ?>"><?php wp_list_categories('orderby=name&title_li='); ?></a></li>
but, that doesn’t work. It lists all categories but doesn’t highlight the current one.