Edit
In this case, it appears that the problem is that you’re not actually outputting a custom nav menu at all, but rather the menu fallback: wp_page_menu()
. Notice that the classes for the list items are page-item
rather than menu-item
. That’s a sure giveaway that the output is being generated by wp_page_menu()
rather than wp_nav_menu()
.
Solution: Ensure that you have created a custom nav menu, and assigned it to the menu_principal
Theme Location.
Original Answer
Long answer, short: you’re using the correct method to modify menu_class
, and in the process, likely stepping on changes that were made to wp_nav_menu()
between WordPress 3.6 and 3.7.
Instead of messing with items_wrap
, you need to be manipulating menu_class
, which is the correct parameter for defining the class applied to the menu element output by wp_nav_menu()
:
$menu_class
(string) (optional) The class that is applied to the
ul
element which encloses the menu items. Multiple classes can be
separated with spaces. Formerly known as$wrap_class
.Default:
menu
Try this:
<?php wp_nav_menu( array(
'container' => false,
'menu_class' => 'nav navbar-nav',
'theme_location' => 'menu_principal'
) ); ?>