WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to figure out how to highlight the parent nav of a page and becoming stuck.

I've seen something like this :

<li <?php if(is_page('services')) { echo 'class="current_page_item"'; } ?> >
     <a href="#">Services</a>

I have different post types going on and I've split each post type into a page, the problem begins when I click down into the "services" tab and click a "service request" the blog navigation highlights instead of the services one.

How can I fix this? I don't mind using PHP or CSS for this as the site is for myself.

share|improve this question
please post whatever code you are using to create your nav – Michael May 13 '13 at 20:32
just using the standard wp_nav at the moment. <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?> – user1888564 May 13 '13 at 20:50
if you use the walker you do need to add any PHP to highlight current page item, there are CSS classes made for that : .current-menu-item {} and current_page_item {} – JMau May 14 '13 at 12:10
have tried all variations of current_page_item etc the ancestor class is working at the moment for parent pages... – user1888564 May 14 '13 at 20:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.