Post Pic

How to: Highlight the current category

Most readers like to know where they are on a website. To help them knowing what they’re exactly browsing right now, you should definitely highlight the current category. It is very easy to do, just read on.

When you're browsing a category, WordPress automatically add a current-cat css class to the <li> element.

So the only thing you have to do is to edit your style.css file and add a style for the current-cat class:

#nav .current-cat{
    background:#999;
    color:#222;
    text-decoration:underline;
}

That's all! Now your readers will know exactly what they're browsing right now.

Leave a Comment

* Name, Email, Comment are Required