Style WordPress Sub Page Menus

Wordpress How-To's

Here’s a problem I’ve recently encountered while using the wp_list_pages function for a sub-page menu. The problem was that the “current_page_item” class was cascading to all the sub-page elements.

Here’s what it was looking like:

The particular function I was using was this:

 <?php wp_list_pages('title_li=&child_of=5'); ?> 

And here is what was rendered with that code:


All you need to do to control the sub-pages is to add a line to your CSS file. All I had to do was the tell it to use white instead of gray for the link color. Here’s the CSS I used:

li.current_page_item ul li a {
color:#FFF; !important;

Here’s what it looked like after the CSS fix:

What's the Buzz?

Andy is a true top notch programmer with a great eye for design, style and balance. When I out source web development projects, I look for qualified and competent programmers that can understand the big picture, add value throughout entire process, and pays close attention to the details – Andy fits the bill.

Andy is well-versed in web development using various programming languages and CMS platforms. Andy is able to deliver a flawless website based on the creative vision and project requirements. He is able to do it on time and on budget.

I highly recommended Andy as a web developer and give him four stars on his professionalism.

- John LeDonne
LeDonne Creative