Current Navigational Highlighting

Okay, so currently, my menu is partially working. Here is my website. Home, Projects, Contact, Shop, and Support all have current navigational highlighting. I am using the same exact code, switching out the class names, for Blog and Forums, and yet, they do not highlight when you are on their respective pages. I can not figure out why. Also, if I select Feel Good Candy or Leaflet from the drop-down menu, it highlights the entire menu, beginning with Projects and ending with Leaflet. I need it to highlight the selected menu li and also highlight Projects, but not the other unselected menu li. Any suggestions?

And it works. But alas, if I make a new forum, the body class will change once more. How do I ensure that my body class will equal blog or forums for simplicity’s sake? I would really appreciate some help on this. Thank you in advance!

Edit #1:@AlenAbdula, sorry, I did not see your message. Targeting #main-navigation instead of each individual item is probably more logical. I will try it out. Also, @chriscoyier suggests against using a class of .current in his tutorial here, which is where the method I am using originates from.

Edit #2:@AlenAbdula, thank you for the suggestion about targeting the #main-navigation li a instead of writing each one out individually. Now, I just need to figure out this current navigational highlighting.

Here is the page if you want to see it for yourself. How am I supposed to use a blank body class? Also, this disabled current navigational highlighting for all of my pages, but I do realize I need to remove “page” from the body class definition in my CSS.

If you go to `wp-includes/post-template.php` on line 316 there is a function `get_post_class` that should be generating classes you need. For some reason this is not returning anything. You either changed some settings or something is broken. Did you add any custom functions to your `functions.php` file?

Tips

What now? I have some ideas for you.

Go explore CodePen!

As a front end designer and developer, you should have an account on CodePen so you can save your snippets, present your ideas, and engage with other front end folk. I'd encourage you to go PRO as well, to unlock the full power of CodePen.

Get the newsletter!

You should sign up for the CSS-Tricks newsletter. It's a clean copy of all the blog posts each week, combined together, right to your inbox. If email isn't your thing, there is an RSS feed, iTunes, and lots of other ways to subscribe.

Listen to ShopTalk!

Subscribe to The Lodge!

The Lodge is a members-only, ad-free video learning area here on CSS-Tricks. Just like the free screencasts, but organized into four large complete series. Membership is also the #1 best way to support CSS-Tricks.

We can do the real footer now.

Site Links

Colophon

CSS-Tricks* is created, written by, and maintained by Chris Coyier. It is built on WordPress, hosted by Media Temple, and the assets are served by MaxCDN. The fonts are Source Sans and Source Code Pro. It is made possible by viewers like you who subscribe to The Lodge and through advertising for products and services I like.