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 am using Wordpress 3+ and Bootstrap 3. To generate the menus I am using the Bootstrap navwalker and the following code...

<?php $args = array('theme_location' => 'primary',
'container_class' => 'navbar-collapse collapse', 
'menu_class' => 'nav navbar-nav',
'fallback_cb' => '',
'menu_id' => 'main-menu',
'walker' => new wp_bootstrap_navwalker()); 
wp_nav_menu($args); ?>

This works great and highlights the menu item when in that section correctly on a parent page, but on a child page, I can't work out how to highlight the menu item.

Any ideas? Basically I have a menu item called 'NEWS'. When i click into a single post in the NEWS section, i want the menu item 'NEWS' to be highlighted like it is on the news post page.

share|improve this question
What is "Bootstrap navwalker"? – Rarst Jan 3 '14 at 18:54
navwalker is a phpp script to turn bootstrap menus into wordpress ones... github.com/twittem/wp-bootstrap-navwalker – lowercase Jan 4 '14 at 16:34

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.