Posts Tagged ‘dynamic’

My recent favourite thing about WordPress – built in dynamic menu highlighting in CSS

Wednesday, May 27th, 2009

OK, I might be way behind with this little revelation but I’ve just discovered how easy it is to highlight the ‘current page’ in WordPress. It’s a great navigation aid for viewers to know which page they are looking at by having some indication in the nav bar. I first tried looking at some plugins, but I should have known that WordPress would have thought of this and have already built it into the CSS. All you need to do is add these classes to the stylesheet and style them as you see fit:

.page_item {
background-color: #ccc;
color:#000
}

.current_page_item {
background-color: #000;
color:#fff
}

Thanks to Gudstoff for this little gem!