0
votes

In a custom template file I'm inserting one of my custom menus:

<?php wp_nav_menu( array('menu' => 'Internal' ));?> 

However the menu fails to generate the class current-menu-item for the current li item.

I am inserting a menu in the same way for menus in other pages without any issues.

What might cause Wordpress to fail output of the current-menu-item?

Cheers Teodor

2

2 Answers

3
votes

Try to use wp_reset_query() function.

            <?php 
                 wp_reset_query();

                 wp_nav_menu( array('menu' => 'Internal' ));
             ?>
0
votes

Try to use the menu function

<?php wp_nav_menu( array('theme_location' => 'primary','menu' => 'Internal' ));?> 

you will get the .current-menu-item in the li and you can make the effect accordingly