Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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 at 18:54
    
navwalker is a phpp script to turn bootstrap menus into wordpress ones... github.com/twittem/wp-bootstrap-navwalker –  lowercase Jan 4 at 16:34

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.